https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • j

    johtso

    03/11/2023, 4:25 PM
    yeah, it did seem like you could get pretty far with that!
  • j

    johtso

    03/11/2023, 4:28 PM
    the one rule limit is kind of restrictive though
  • j

    johtso

    03/11/2023, 4:30 PM
    probably enough though when I think about it
  • j

    johtso

    03/11/2023, 6:08 PM
    can durable objects not have cron triggers?
  • d

    Dani Foldi

    03/11/2023, 6:12 PM
    They have something similar called alarms, which are actually more precise, but you have to schedule it every time
  • h

    HardAtWork

    03/11/2023, 6:12 PM
    No, but they can have Alarms
  • d

    Dani Foldi

    03/11/2023, 6:12 PM
    ha, got you
  • h

    HardAtWork

    03/11/2023, 6:12 PM
    Deletes your message so I’m first…
  • j

    johtso

    03/11/2023, 6:13 PM
    yeah, just would be nice to have the simplicity of cron triggers you could twiddle in the dashboard
  • d

    Dani Foldi

    03/11/2023, 6:13 PM
    cries in non-colored dev expert
  • j

    johtso

    03/11/2023, 6:13 PM
    curious if it's something that's planned
  • h

    HardAtWork

    03/11/2023, 6:13 PM
    I mean, you can pass Cron Triggers into a DO
  • h

    HardAtWork

    03/11/2023, 6:14 PM
    Probably not. You can pass them in if you need them, or otherwise build your own with Alarms
  • j

    johtso

    03/11/2023, 6:14 PM
    get yer hands dirty
  • h

    HardAtWork

    03/11/2023, 6:14 PM
    There’s not really much of a need that doesn’t work there
  • j

    johtso

    03/11/2023, 6:14 PM
    I'm kind of surprised there aren't more abstractions built on top of DOs
  • j

    johtso

    03/11/2023, 6:15 PM
    oh wait of course, there's do-taskmanager!
  • d

    Dani Foldi

    03/11/2023, 6:18 PM
    and
    do-transactional-outbox
  • j

    johtso

    03/11/2023, 6:20 PM
    has anyone made a cloudflare worker / DO resources cheat sheet github repo or something?
  • j

    johtso

    03/11/2023, 6:20 PM
    with all these things linked
  • j

    johtso

    03/11/2023, 6:21 PM
    itty-durable, do-taskmanager, do-transactional-outbox..
  • t

    thisbetom.eth

    03/11/2023, 6:32 PM
    Not sure where to log this bug but AFAICanTell DO local encoding for keys is creating folders instead of files in memory and causing errors when colons exist in strings.
    Copy code
    // npx wrangler dev --local # MacOS wrangler 2.12.2
    do.storage.put({
      'this:that': 0, // becomes a directory in /private and throws errors on future delete / access
    })
  • s

    Skye

    03/11/2023, 6:34 PM
    That looks like a miniflare bug
  • s

    Subh

    03/11/2023, 8:18 PM
    Hey team, I removed one DO call and one Queue call, my api response time down from ~1200ms to ~350ms. When I just remove addRefreshToken method which puts to Token Do, reduce the latency to ~680ms. Is this expected? I mean internal DO calls take ~500ms? and queue call adds ~300ms?
    Copy code
    ts
    const promises = await Promise.all([
      userClient.createSession(applicationInfo, sessionId, refreshToken),
      /* 
      addRefreshToken(c, refreshToken, sessionId, userId),
      c.env.AUTHC1_ACTIVITY_QUEUE.send({
        acitivity: "LoggedIn",
      }), 
      */  
    ]);
  • f

    frankichiro

    03/11/2023, 8:21 PM
    Hello. I'm having trouble finding instructions on how to use a Durable Object in a separate Worker in local development. I am running both instances at the same time, but my Worker says "DurableObjectError [ERR_CLASS_NOT_FOUND]". How is this supposed to be set up?
  • a

    alias

    03/12/2023, 12:17 AM
    Have you followed the guide here? https://miniflare.dev/storage/durable-objects You also need to make sure the DO are exported from the main CF entry point
  • f

    frankichiro

    03/12/2023, 1:40 AM
    Isn't miniflare part of wrangler? Do I need to install miniflare separately, or what? Seriously, this is so confusing...
  • f

    frankichiro

    03/12/2023, 1:42 AM
    "Ignored: "miniflare": Wrangler does not use configuration in the
    miniflare
    section. Unless you are using Miniflare directly you can remove this section."
  • f

    frankichiro

    03/12/2023, 2:00 AM
    I did get a separate Durable Object Worker to work locally together with a Pages project, by using the
    --do
    flag, but it's not available for Workers for some reason.
  • f

    frankichiro

    03/12/2023, 2:03 AM
    So how do I access a Durable Object locally from another Worker, without
    --do
    or
    --do-persist
    ?
1...516517518...567Latest