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

    brett

    05/05/2021, 5:03 PM
    Durable Objects have a persistent storage API, check out the Counter example there
  • a

    Adam Reed

    05/05/2021, 5:03 PM
    Great ty!
  • b

    brett

    05/05/2021, 5:03 PM
    It shows how to persist state, and reload from storage when the object is brought back to life if it was evicted
  • b

    brett

    05/05/2021, 5:03 PM
    The end user can't tell at all
  • a

    Adam Reed

    05/05/2021, 5:04 PM
    We're looking to use it as the backend session actor for a web app, and wrap the DO functions in worker endpoints to act on it.
  • a

    Adam Reed

    05/05/2021, 5:04 PM
    DO per session.
  • g

    Gavin

    05/05/2021, 6:45 PM
    is there only ever one DO instance? can i use things like mutexes to lock off a section of code to one request at a time?
  • u

    Unsmart | Tech debt

    05/05/2021, 8:54 PM
    Yes there is only one instance
  • g

    Gavin

    05/05/2021, 9:12 PM
    what's the best way to pass your env to the DO? i want to use things like the secrets and kv there
  • u

    Unsmart | Tech debt

    05/05/2021, 9:14 PM
    its the 2nd arg in the constructor there by default
  • g

    Gavin

    05/05/2021, 9:14 PM
    oh sorry. my bad
  • g

    Gavin

    05/05/2021, 9:14 PM
    thanks
  • u

    Unsmart | Tech debt

    05/05/2021, 9:14 PM
    np 🙂
  • t

    ttraenkler

    05/06/2021, 8:29 AM
    did you have a chance to look at the
    jsonwebtoken
    esm issue with rollup? we've tried using @rollup/plugin-node-resolve but we're getting
    ReferenceError: require is not defined
    Copy code
    ts
     nodePolyfills(),
        nodeResolve({ browser: true, 
          preferBuiltins: false }),
        commonjs(),
    we tried different setups as well but so far without success
  • e

    Erwin

    05/06/2021, 8:40 AM
    No, been wrecking my brain all day trying to find a fix for an issue I had. When in the end I realised it could be done by literary replacing one variable name 🤬
  • t

    ttraenkler

    05/06/2021, 8:41 AM
    sounds familiar
  • e

    Erwin

    05/06/2021, 8:47 AM
    Can you do me a favour and try ‘mode-jose’ package that @User linked above? I won’t have time tomorrow most likely 😕
  • g

    Greg Brimble | Cloudflare Pages

    05/06/2021, 8:55 AM
    I actually just spent all day yesterday doing JWT stuff and switched over to
    jsrsasign
    . I think
    node-jose
    introduced some breaking changes in v2 since I last looked at it.
  • e

    Erwin

    05/06/2021, 10:30 AM
    Make up your mind @User 🤣. Btw, should you be on a beach somewhere?!
  • g

    Greg Brimble | Cloudflare Pages

    05/06/2021, 10:32 AM
    Sorry!! But nah, I've been looking forward to getting back to stuff I enjoy working on for too long!
  • t

    ttraenkler

    05/06/2021, 11:21 AM
    sure, thanks
  • a

    Adam Reed

    05/06/2021, 7:09 PM
    What's the max lifetime of a DO object?
  • d

    Deleted User

    05/07/2021, 9:08 AM
    is there any way to send a gzipped request to a DO and have the DO store the raw gzipped response?
  • d

    Deleted User

    05/07/2021, 10:18 AM
    also are DOs not in 1.16.1?
  • d

    Deleted User

    05/07/2021, 10:29 AM
    how do you exclude
    *.ts
    in the current format?
  • t

    ttraenkler

    05/07/2021, 5:10 PM
    does wrangler
    v1.16.1
    include durable objects support of
    v1.16.0-durable-objects-rc.0
    ?
  • d

    Deleted User

    05/07/2021, 5:33 PM
    seems like it
  • k

    kristian

    05/07/2021, 5:55 PM
    cc @User @User
  • m

    matt

    05/07/2021, 5:56 PM
    No, it doesn’t, but DO support for wrangler will be part of a normal release soon
  • d

    Deleted User

    05/07/2021, 6:14 PM
    any chance we could get higher limits for value sizes someday?
1...787980...567Latest