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

    HardAtWork

    03/28/2023, 4:37 PM
    Wut
  • h

    HardAtWork

    03/28/2023, 4:38 PM
    Maybe that’s a Pages thing…
  • s

    Skye

    03/28/2023, 4:43 PM
    that's in local mode, it's a bit different
  • h

    HardAtWork

    03/28/2023, 4:44 PM
    Oh, that makes sense
  • a

    avi

    03/29/2023, 12:26 AM
    will a
    setInterval
    keep a DO alive?
  • k

    kenton

    03/29/2023, 1:05 AM
    No. If there are no clients connected, the DO will shut down after a bit even if there's a future setInterval or setTimeout pending.
  • k

    kenton

    03/29/2023, 1:05 AM
    To schedule tasks to happen reliably at some future point, use alarms
  • a

    avi

    03/29/2023, 1:20 AM
    got it! and what about pending network or async requests? do those keep the DO alive, or is it truly ONLY connected HTTP/WS connections?
  • u

    Unsmart | Tech debt

    03/29/2023, 1:37 AM
    Afaik only active traffic to the object will keep it alive.
  • c

    Crazy Rabbit

    03/29/2023, 6:57 AM
    Can anyone send me more advanced examples of durable objects?
  • h

    HardAtWork

    03/29/2023, 8:35 AM
    #992060581832032316?
  • h

    HardAtWork

    03/29/2023, 8:36 AM
    LogTail?
  • c

    Crazy Rabbit

    03/29/2023, 8:36 AM
    For durable objects
  • h

    HardAtWork

    03/29/2023, 8:37 AM
    Both of those are built on #773219443911819284…
  • h

    HardAtWork

    03/29/2023, 8:37 AM
    Also, part of R2
  • c

    Crazy Rabbit

    03/29/2023, 8:38 AM
    I'm already using R2, D1, KV..., but for this specific example DOs would be better option.
  • c

    Crazy Rabbit

    03/29/2023, 8:38 AM
    https://discordapp.com/channels/595317990191398933/874727019479437372/1090384086243217468
  • h

    HardAtWork

    03/29/2023, 8:40 AM
    I meant, you were asking for examples of what you can build on DOs? Those are some examples that are using DOs
  • c

    Crazy Rabbit

    03/29/2023, 8:42 AM
    ohh, I mean like how to use them in a little more advanced example like manipulating with data, storing arrays, json, sending data to durable objects....
  • c

    Crazy Rabbit

    03/29/2023, 8:43 AM
    the only example in docs is just increasing and decreasing the integer
  • c

    Crazy Rabbit

    03/29/2023, 8:45 AM
    So you can supply data to DO thru json right?
  • s

    Skye

    03/29/2023, 8:49 AM
    You interact through DOs from workers with requests, you can put whatever you want in the bodies of those requests
  • c

    Crazy Rabbit

    03/29/2023, 8:49 AM
    Thanks
  • c

    Crazy Rabbit

    03/29/2023, 8:53 AM
    So state.storage is like KV?
  • c

    Crazy Rabbit

    03/29/2023, 8:53 AM
    key value store
  • s

    Skye

    03/29/2023, 8:54 AM
    It's similar, yes
  • s

    Skye

    03/29/2023, 8:54 AM
    But it's tied to each individual durable object, rather than data being shared across the whole namespace
  • c

    Crazy Rabbit

    03/29/2023, 9:02 AM
    and if you put integer in state.storage it gets returned as string?
  • h

    HardAtWork

    03/29/2023, 9:24 AM
    No
  • h

    HardAtWork

    03/29/2023, 9:25 AM
    DO Storage can store anything that the V8 serializer can parse
1...526527528...567Latest