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

    Deleted User

    04/16/2021, 4:55 PM
    if it compiles to es6 modules you construct and return a response instead
  • t

    Till

    04/16/2021, 4:55 PM
    Yes, I need to use
    event.waitUntil()
    .
  • t

    Till

    04/16/2021, 4:56 PM
    But I don't see any of way accessing that class.
  • g

    Greg Brimble | Cloudflare Pages

    04/16/2021, 5:13 PM
    It's not available with on the ESM stuff just yet. The team are working on adding it soon 🙂
  • d

    Deleted User

    04/16/2021, 5:14 PM
    would a normal
    await
    work?
  • t

    Till

    04/16/2021, 5:18 PM
    Thanks! How can I follow the development of that?
  • g

    Greg Brimble | Cloudflare Pages

    04/16/2021, 5:21 PM
    Here, #802187271067140107 , and developer docs 🙂
  • a

    Adam Reed

    04/16/2021, 5:53 PM
    Hello, I was unable to signup for the beta on my account.
  • a

    Adam Reed

    04/16/2021, 5:53 PM
    When I click the Signup link it takes me to my dashboard 😦
  • g

    Greg-McKeon

    04/16/2021, 7:11 PM
    If you navigate to Workers, then durable objects, you should be able to enable the beta
  • a

    Adam Reed

    04/16/2021, 7:11 PM
    I couldn't find the link under my workers area. Ill try again ty
  • g

    Greg-McKeon

    04/16/2021, 7:16 PM
    should be in the top nav
  • a

    Adam Reed

    04/16/2021, 7:20 PM
    Curious if anyone can tell me, but would it be possible to store say a .wav in a durable object?
  • a

    Adam Reed

    04/16/2021, 7:20 PM
    I am trying to find limitations on them.
  • a

    Adam Reed

    04/16/2021, 7:21 PM
    I can't seem to find any data on size/data limitations.
  • g

    Greg Brimble | Cloudflare Pages

    04/16/2021, 7:23 PM
    Memory is limited to 128MB, and each key-value is 32KB, (but unlimited key-values).
  • a

    Adam Reed

    04/16/2021, 7:23 PM
    So durable objects is essentially an in-memory object storage, like Memcached but distributed.
  • g

    Greg Brimble | Cloudflare Pages

    04/16/2021, 7:23 PM
    A
    .wav
    probably lends itself more to KV, since it's unlikely you need synchronized storage?
  • g

    Greg Brimble | Cloudflare Pages

    04/16/2021, 7:23 PM
    KV has a max-size of 25MB per key
  • a

    Adam Reed

    04/16/2021, 7:24 PM
    Ah, KV sounds more ideal then.
  • b

    brett

    04/16/2021, 7:24 PM
    Data stored as JS fields are, of course, in-memory. But those stored via the actual storage API are durable: https://developers.cloudflare.com/workers/runtime-apis/durable-objects#transactional-storage-api
  • b

    brett

    04/16/2021, 7:24 PM
    But yes, KV would be a better fit for media files -- you could use it from a Durable Object
  • g

    Greg Brimble | Cloudflare Pages

    04/16/2021, 7:25 PM
    I would think so! And people have been using KV for all sorts of stuff for ages, so probably more battle-tested for you 🙂
  • a

    Adam Reed

    04/16/2021, 7:25 PM
    @User And what are the limitations on on that?
  • b

    brett

    04/16/2021, 7:25 PM
    > Keys are limited to a max size of 2048 bytes and values are limited to 32 KiB
  • b

    brett

    04/16/2021, 7:26 PM
    That storage would typically be used for application data, and KV could hold media (like your .wav)
  • a

    Adam Reed

    04/16/2021, 7:26 PM
    @User Awesome, thank you. We're gonna put together a test.
  • a

    Adam Reed

    04/16/2021, 7:26 PM
    We need to serve .wavs to Twilio VERY quickly.
  • a

    Adam Reed

    04/16/2021, 7:26 PM
    And our current implementation was hosting a cluster of Memcached servers on AWS to be close to Twilio (AWS Hosted)
  • b

    brett

    04/16/2021, 7:27 PM
    If they don't change frequently you might try KV with the cacheTtl parameter https://developers.cloudflare.com/workers/runtime-apis/kv#cache-ttl
1...626364...567Latest