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

    kenton

    02/07/2021, 1:41 AM
    I'd like to add support for request formats other than
    fetch()
    , but we're sticking with
    fetch()
    for now mostly to avoid having to spend a lot of time thinking about exactly what we want here. Personally, I'm hoping to add some sort of direct Cap'n Proto support, since under the hood all the communication is actually over Cap'n Proto, not HTTP.
  • k

    kenton

    02/07/2021, 1:42 AM
    I imagine we'll also consider something where we just use "structured clone" serialization to let you send arbitrary values, without having to worry about serialization
  • k

    kenton

    02/07/2021, 1:42 AM
    but yeah, this is all still undecided
  • g

    Greg Brimble | Cloudflare Pages

    02/07/2021, 1:44 AM
    That would be ideal. But I totally understand that it's not a priority, since it can be quick easily worked around with these wrappers.
  • g

    Greg Brimble | Cloudflare Pages

    02/07/2021, 1:46 AM
    In the "limitations of the beta" section of the docs, one thing that's listed is the inability to access a DO (or KV) from a DO. Is that something that's eventually planned? I could easily foresee a usecase where you want to store a reference to a >32KB object being held in KV, from a DO.
  • k

    kenton

    02/07/2021, 1:47 AM
    eh? If the doc says that, it's wrong...
  • k

    kenton

    02/07/2021, 1:47 AM
    durable objects have always been able to talk to each other -- the chat demo uses this. And KV is perfectly accessible from DO as well...
  • g

    Greg Brimble | Cloudflare Pages

    02/07/2021, 1:49 AM
    Oh, I might have misunderstood it? It's that a DO can't access another DO's storage not another DO just in general. https://developers.cloudflare.com/workers/learning/using-durable-objects#cross-object-storage-access
  • k

    kenton

    02/07/2021, 1:49 AM
    ahhh
  • k

    kenton

    02/07/2021, 1:50 AM
    ... hmm, that's weird that that's listed as a beta limitation, since it's inherent to the design of durable objects and is not something we'd change later.
  • g

    Greg Brimble | Cloudflare Pages

    02/07/2021, 1:51 AM
    Is there anything else listed there that won't be removed as a limitation post-beta?
  • k

    kenton

    02/07/2021, 1:52 AM
    no, the other points all look like things we're working to fix
  • g

    Greg Brimble | Cloudflare Pages

    02/07/2021, 1:53 AM
    Amazing! Well, I had a lot of fun trying stuff out today, so my kudos to you and the team for building such cool stuff! 🧡
  • g

    Greg Brimble | Cloudflare Pages

    02/07/2021, 1:53 AM
    (and thanks for answering all my questions!)
  • k

    kenton

    02/07/2021, 1:55 AM
    thanks for the feedback!
  • t

    tp

    02/07/2021, 1:56 AM
    I've tried this with a non home server as well so 100% sure its not my connection
  • k

    kenton

    02/07/2021, 2:00 AM
    docs update: https://github.com/cloudflare/cloudflare-docs/pull/746
  • k

    kenton

    02/07/2021, 2:07 AM
    Sorry that debugging is really difficult right now. We really need to come up with some sort of preview support so that you can iterate without pushing and waiting 30 seconds, and so you can console.log() and see uncaught exceptions. Preview with durable objects is a surprisingly hard problem though... we're working on it.
  • t

    tp

    02/07/2021, 2:08 AM
    is there anything you can think of that would get me disconnected?
  • t

    tp

    02/07/2021, 2:08 AM
    is it the overly large volumes of data im sending, ~15kbps
  • t

    tp

    02/07/2021, 2:08 AM
    max at 30kbps
  • t

    tp

    02/07/2021, 2:08 AM
    it trips out the more data i send through, im not storing anything through its just send to ws subscribers
  • k

    kenton

    02/07/2021, 2:09 AM
    My guess would be that you are not getting disconnected, but the code is somehow failing to handle messages, and the exceptions aren't being reported anywhere so it's hard to tell what's happening
  • t

    tp

    02/07/2021, 2:09 AM
    i thought it was that, i added an error hook. So i connect in with another websocket and add a 'listener', and now if another socket has an error it sends a message to the listener
  • t

    tp

    02/07/2021, 2:09 AM
    but i dont get anything on that
  • t

    tp

    02/07/2021, 2:10 AM
    is webSocket.send blocking (does it need to be await webSocket.send)?
  • k

    kenton

    02/07/2021, 2:10 AM
    the error hook reports connection errors, but it doesn't report when your message handler threw an exception
  • t

    tp

    02/07/2021, 2:10 AM
    i modified it in the latest git
  • k

    kenton

    02/07/2021, 2:10 AM
    No, you don't need to await `send()`s
  • t

    tp

    02/07/2021, 2:10 AM
    so i do a try catch and send the message to the socket with {debug: true} (the one set by a listener)
1...101112...567Latest