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

    krondor

    05/12/2023, 1:20 PM
    Oh! Is there a way to generate them on demand / generate service bindings for that
  • c

    ckoeninger

    05/12/2023, 1:33 PM
    if that question isn't answered by https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#object-stubs let us know what would make it clearer
  • t

    the11011

    05/12/2023, 1:38 PM
    Hey guys! May can anyone help me with this error: In order to use Durable Objects, you must agree to pricing at https://dash.cloudflare.com/$ID/workers/overview?enable-durable-objects [code: 10084] I got enterprise subscription and cannot find anything related to DO enabling in UI.

    https://cdn.discordapp.com/attachments/773219443911819284/1106576198567465020/image.png▾

  • d

    dave

    05/12/2023, 1:39 PM
    let's switch to #779390076219686943
  • c

    ckoeninger

    05/12/2023, 2:11 PM
    DM me your account id. We're hopefully going to remove that check altogether today.
  • m

    mxck

    05/12/2023, 3:11 PM
    Same error :\
  • i

    ItsWendell

    05/12/2023, 3:15 PM
    Hi! We're looking to build some type of push system to send messages to our app cliënt in as real-time as possible, considering websockets are priced at wall-time, would the same be the case for server-sent events?
  • i

    ItsWendell

    05/12/2023, 3:16 PM
    Does anyone has any other recommendations on how to do this on the cheap, without paying +-5 dollars per hour for an connection to be open to a durable object?
  • u

    Unsmart | Tech debt

    05/12/2023, 3:18 PM
    Its $4.22/mo for each DO (if active all month) not $5 per hour. But the team has been working on a hibernation API that will sleep the durable object if it isnt actively handling a message from a websocket. No clue when that will actually come out but its been in talks the last few months.
  • i

    ItsWendell

    05/12/2023, 3:20 PM
    Ahhh okay got my pricing all off then, that's actually pretty decent.
  • i

    ItsWendell

    05/12/2023, 3:34 PM
    Are there any similar libraries like DOG that came out? https://github.com/cloudflare/dog
  • u

    Unsmart | Tech debt

    05/12/2023, 3:43 PM
    Not that I am aware of
  • i

    Iann

    05/12/2023, 6:19 PM
    Do we know the minimum storage of a DO, or rather, how many bytes a DO takes even when no data is stored ?
  • d

    Dani Foldi

    05/12/2023, 6:22 PM
    we happen to know it! 0 bytes unless you explicitly use the storage API
  • i

    Iann

    05/12/2023, 6:24 PM
    The key value data is stored as is right, with no compression
  • d

    Dani Foldi

    05/12/2023, 6:26 PM
    it is serialized with v8's serializer
  • d

    Dani Foldi

    05/12/2023, 6:26 PM
    but no further compression afaik
  • h

    HardAtWork

    05/12/2023, 6:26 PM
    It might be compressed, but you are billed for what you send
  • s

    sathoro

    05/12/2023, 6:28 PM
    weird situation happened - I am pretty sure I had a DO get "stuck" until I opened
    wrangler tail
    which finally restarted it. we have a task queue that is triggered by alarms. there was a task in the queue that was stuck for a few hours. in the alarm, it finds stuck tasks and then immediately updates storage to increment a value and then continues on with the work that value was never set and even though I was triggering the alarm it wasn't picking up that the task was "stuck" (which is defined by a field not being updated in 30 minutes but it had been 3 hours) anyways, as soon as I opened
    wrangler tail
    (which restarts DOs) within a minute it "un-stuck" the item in the queue and updated the storage as expected
  • u

    Unsmart | Tech debt

    05/12/2023, 6:28 PM
    That code happens to be open source so you can see how it is counted https://github.com/cloudflare/workerd/blob/main/src/workerd/api/actor-state.c%2B%2B
  • i

    Iann

    05/12/2023, 6:28 PM
    Got it thanks !
  • c

    ckoeninger

    05/12/2023, 6:29 PM
    if you have a DO id (not the name you passed to idFromName, the 64 character hex id) for that DO instance, DM it to me
  • s

    sathoro

    05/12/2023, 6:30 PM
    I only have the name... one sec let me see what I can do
  • c

    ckoeninger

    05/12/2023, 6:31 PM
    given a name, OBJECT_NAMESPACE.idFromName is deterministic for a given namespace so you'd just need the result of calling .toString on that return value
  • s

    sathoro

    05/12/2023, 6:39 PM
    working on this, a bit confusing with itty-durable
  • a

    Advany

    05/12/2023, 6:40 PM
    I am new to DO's. I am trying to schedule a mail channels email using DO alarms... I have this code: https://codeshare.io/N36zBd Is this the best way to do it? And what would be DO cost of this be per email scheduled and then triggered? Is there a way to calculate that?
  • s

    sathoro

    05/12/2023, 6:44 PM
    DMd 🙂
  • c

    ckoeninger

    05/12/2023, 9:45 PM
    Couple of things I noticed - scheduler.fetch needs to be passed a Request object or a valid url (even though the domain doesn't matter). storage.setAlarm takes a single argument (Date or integer millis) not a pair of arguments. Making a new DO for every email you send is an interesting choice, do you know how frequently you're going to be sending them?
  • u

    Unsmart | Tech debt

    05/12/2023, 9:52 PM
    Speaking of creating new DOs... > Error: Your account is generating too much load on Durable Objects. Please back off and try again later. > There is a limit on how quickly you can create new objects or lookup different existing objects Is there any specific limit we can actually judge if we will be creating/looking up too many DOs?
  • h

    HardAtWork

    05/12/2023, 9:55 PM
    How have I not hit that yet lol?
1...552553554...567Latest