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

    Electroid

    07/30/2021, 6:44 PM
    we're looking at better rust support, soon(tm)
  • w

    Wallacy

    07/30/2021, 8:51 PM
    Another question: Will storage.list() have a different tier price than storage.get() like in KV? And the get(keys) that is limited do 128 keys, will count like 128 read requests? ... Im asking that because im changing my get(keys) for .list() because in that way i dont need to store all target keys separately, only the pattern. On KV this is a bad ideia because just to list costly 5x and i need to make each .get anyway....
  • w

    Wallacy

    07/30/2021, 8:51 PM
    If on DO the list and get multiple keys cost the same i will prefer the list in few places.
  • s

    Subh

    08/01/2021, 2:34 AM
    Hey team! I trying to understand what is the recommended way to DO. I was looking at https://github.com/kwhitley/itty-durable/blob/v0.x/examples/counters/index.js#L28-L30
    Copy code
    const withListOfCounters = request => {
      request.ListOfCounters = request.Counters.get('all')
    }
    this pretty much getting all the records. So if I had 1M, it will loop through all of them. Right? Which is okay?
  • i

    ItsWendell

    08/01/2021, 11:15 PM
    Hi all! Due to my personal interest in serverless technology, websockets and real-time applications, I am exploring Cloudflare Workers and would love to play with Durable Objects. It seems like I have to upgrade to a Paid plan in order to do this, once I do that, is it possible to set manual limits on spending? I mainly want to make sure I don't accidentally create huge bills that I can't afford.
  • e

    elithrar

    08/02/2021, 1:00 AM
    You can set alerts but not limits on paid plans. Free plans have options to fail open / fail closed.
  • e

    elithrar

    08/02/2021, 1:01 AM
    https://developers.cloudflare.com/workers/platform/limits for limits
  • e

    elithrar

    08/02/2021, 1:02 AM
    https://support.cloudflare.com/hc/en-us/articles/115004555148-Understanding-Billing-for-Add-on-Services for creating alerts
  • a

    albert

    08/02/2021, 9:41 AM
    Would it be possible to run a "regular" Discord bot using a Durable Object. The gateway connection is basically just a websocket, right?
  • k

    kavinplays

    08/02/2021, 12:12 PM
    even if say it is possible, it wouldn't be the best way to run a discord bot, as it won't be scaled
  • g

    Greg-McKeon

    08/02/2021, 7:50 PM
    List and get are both billed as reads based on examined data. The difference is that, if you're reading less than 4KB of data, .get() will incur one read charge for every key read read, whereas list will incur one charge for every 4KB of returned data.
  • w

    Wallacy

    08/02/2021, 8:05 PM
    Thanks, i think that you want to say that .get() will charge for one read if is "more" than 4KB right? ... So .get(upTo128keys) will be charge a one operation per key. And list(pattern) one charge for every 4KB doesn't matter how much keys; Thats sounds very, very reasonable.
  • w

    Wallacy

    08/02/2021, 8:07 PM
    Or does .get() will be charge for one operation for every 4KB round to the next 4KB increment? .get() a 8KB data will be two operations?
  • w

    Wallacy

    08/02/2021, 8:13 PM
    Just to make sure, the KV storage does not have such data billing right? Is just the api call cost rigth?
  • h

    HardAtWork

    08/02/2021, 8:28 PM
    Anyone know if there is a way to manually purge the storage of a DO, other than just deleting and re-adding the class?
  • g

    Greg-McKeon

    08/02/2021, 8:41 PM
    Durable Objects are free until they're out of beta. Also make sure the Workers you're using to call them are on the Bundled plan.
  • g

    Greg-McKeon

    08/02/2021, 8:44 PM
    to be clear, a get() of 3KB is one read. 8KB is two reads, etc. and list, it does matter how many keys you have, since that will increase the amount of data returned 🙂 Workers KV is separate, and bills per-operation regardless of size.
  • i

    ItsWendell

    08/02/2021, 8:53 PM
    Thank you, I just got a bundled plan and experimenting with it 😄
  • j

    john.spurlock

    08/02/2021, 11:13 PM
    No rest api call to clear storage at the moment, other than deleting the DO namespace, which I believe wrangler does when you delete/re-add the class. You can list all instances for a given DO namespace using the rest api, but then you must create your own api to connect from a worker to each instance and then call
    deleteAll()
    within it. https://developers.cloudflare.com/workers/runtime-apis/durable-objects#:~:text=deleteAll()
  • m

    Murray

    08/03/2021, 9:50 AM
    Could you share a link to the REST API which allows you to list DO instances in a DO namespace? Think this was a new feature being worked on.
  • k

    Kitteh (+dms, GMT)

    08/03/2021, 11:30 AM
    I'm taking a look at the durable objects intro properly for the first time and...I'm missing some key piece of information. The runtime APIs book goes from defining a class to generating an ID in a namespace, but I can't find any information about what consitiutes a namespace, how they're defined, etc.
  • k

    Kitteh (+dms, GMT)

    08/03/2021, 11:34 AM
    The durable-objects-template template uses a namespace which uses the class name, but in all caps, and has...3 layers of indirection for returning a counter?
  • k

    Kitteh (+dms, GMT)

    08/03/2021, 12:04 PM
    Oh, I see, it's defined in the durable_objects section of the wrangler.toml
  • k

    Kitteh (+dms, GMT)

    08/03/2021, 12:28 PM
    Wait, does the durable object only exist inside the worker is is a part of?
  • k

    Kitteh (+dms, GMT)

    08/03/2021, 12:28 PM
    i guess I can call worker containing the DO from another worker...
  • j

    john.spurlock

    08/03/2021, 12:45 PM
    Yep, DMed you the endpoint
  • a

    albert

    08/03/2021, 12:47 PM
    Could you share it with me as well? 🙂
  • e

    eidam | SuperSaaS

    08/03/2021, 1:26 PM
    ❤️ https://blog.cloudflare.com/durable-objects-easy-fast-correct-choose-three/
  • j

    john.spurlock

    08/03/2021, 1:41 PM
    Ooh, thanks for
    noCache: true
  • j

    john.spurlock

    08/03/2021, 1:42 PM
    so a "gate" is a semaphore, no?
1...135136137...567Latest