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

    Robin

    03/13/2021, 6:25 PM
    hey, I've been struggling with my stuff (DO's calling each other's via stubs). I also witnessed issues with websockets just dying. All of these are random and more or less frequent over the minutes. I'm implementing retry mechanisms everywhere and ping/pong over the websockets. But even then, I can get periods where 3 DO's going down and not responding at any fetch() requests for tens of seconds once every hour or so. I get this is a private beta, but i'm getting to a point where stuff becomes too unreliable for wanting to build anything with for now. I'd be glad to get more insights on potential network/server load issues being worked on atm, because I had a much more stable experience last week than this week. 🙂
  • r

    Robin

    03/13/2021, 6:26 PM
    (websockets are for additional non-DO's connections)
  • e

    eidam | SuperSaaS

    03/15/2021, 9:21 PM
    Any changes that would start blocking websockets? 🤔
  • e

    eidam | SuperSaaS

    03/15/2021, 9:22 PM
    I just noticed that websocket connections are failing right away, with no changes on our side (at least I am not aware of any), anyone else can confirm?
  • v

    vans163

    03/15/2021, 9:24 PM
    Hello everyone, we are building on cloudflare and really need durable objects to launch (just message passing, losing data / beta grade is 100% AOK), already applied for beta access 4-6 months ago. No reply yet, I was wondering if it was possible to make a compelling usecase for it and hopefully get the green light sooner.
  • v

    vans163

    03/15/2021, 9:28 PM
    dang no metadata like on KV storage? its so useful for our previews so we dont need to readback the full value
  • e

    eidam | SuperSaaS

    03/15/2021, 9:29 PM
    DO list actually returns the values as well, so you can skip the metadata part
  • v

    vans163

    03/15/2021, 9:30 PM
    is there a timelimit on websocket connections? or they can even stay open hours?
  • v

    vans163

    03/15/2021, 9:32 PM
    also would opening a websocket connection from inside a durable object to another endpoint ever be supported?
  • a

    AlexRobinson

    03/15/2021, 9:42 PM
    @User I don't know of any changes that would have had any effect on websockets today
  • h

    haneefmubarak

    03/15/2021, 9:48 PM
    I'm glad to hear your excitement about using DO; we're working hard to move into open beta soon (as @User has mentioned) and we're excited to hear your feedback when it does launch - stay tuned for updates 🙂
  • v

    vans163

    03/15/2021, 9:49 PM
    Possible to know how soon is soon? Like if soon is not soon we need to make the decision to write a bunch of code that we will thrown into a fire pit once Durable Objects does open to beta. Like is soon is soon enough, we wont allocate resources to that.
  • u

    unalignedant

    03/15/2021, 10:06 PM
    how does one use environment variables in a durable object
  • e

    eidam | SuperSaaS

    03/15/2021, 10:08 PM
    https://developers.cloudflare.com/workers/runtime-apis/durable-objects#durable-object-class-definition tldr;
    Copy code
    ...
    constructor(state, env) {
      this.env = env
    }
    ...
    this.env.ENV_OR_SECRET
    ...
  • u

    unalignedant

    03/15/2021, 10:19 PM
    it is indeed right there 🤦‍♂️ I seem to be unable to edit it in the UI so that threw me. success via wrangler, thanks!
  • e

    eidam | SuperSaaS

    03/15/2021, 10:19 PM
    Seems like Workers are somehow not respecting the
    Upgrade
    header (and doing the magic) anymore 🤔 Or is it possible I reached websocket connections limit?
  • e

    eidam | SuperSaaS

    03/15/2021, 10:29 PM
    It just started working.. no changes on my side, but I tried to upgrade my Cloudflare plan.. so either something on your side or I was indeed somehow rate-limited on websockets connections.. 😅
  • v

    vans163

    03/15/2021, 11:54 PM
    whats the limit for websockets on basic / free plan vs higher plan?
  • a

    andrew | 1003

    03/15/2021, 11:55 PM
    I don't believe there is any official limit... see this: https://community.cloudflare.com/t/cloudflare-websocket-limits/57455
  • v

    vans163

    03/15/2021, 11:56 PM
    wowq tyway more then i need on free tier
  • p

    PhilipA

    03/16/2021, 5:04 PM
    I have been able to open a websocket to another DO. Note that any connection initiated inside a DO would still be subject to the request context and DO appear to have the same subrequest limits as a regular worker.
  • v

    vans163

    03/16/2021, 5:36 PM
    1 message off the websocket is a subrequest?
  • v

    vans163

    03/16/2021, 5:37 PM
    Interesting, if the dns is on cloudflare, it might be possible then to open the websocket to it, even if it's not a worker/do?
  • p

    PhilipA

    03/16/2021, 6:10 PM
    I think one websocket connection counts as a single subrequest.
  • v

    vans163

    03/16/2021, 6:48 PM
    oh thats lovely then, so much potential im very excited
  • v

    vans163

    03/16/2021, 6:48 PM
    wish cloudflare woudl give me closed beta access 💢
  • c

    Ceru ©

    03/16/2021, 8:51 PM
    https://blog.ceru.dev/websockets-at-the-edge/ check out the very last bit of this post
  • v

    vans163

    03/16/2021, 10:32 PM
    did not realize you can fool a browser client into turning a fetch into a websocket conection
  • c

    Ceru ©

    03/16/2021, 10:34 PM
    Nah it's only for Workers
  • c

    Ceru ©

    03/16/2021, 10:34 PM
    Afaik
1...282930...567Latest