Very confused now. I was reading the docs, and it mentions a binding variable, and a class name, but
Very confused now. I was reading the docs, and it mentions a binding variable, and a class name, but no mention of a Namespace ID anywhere.
wrangler? I'm not sure how it maps to the underlying model - I believe it has a concept of environments, perhaps it creates one namespace per env? Not sure. You can always get a list of your DO namespaces with GET https://api.cloudflare.com/client/v4/accounts/<account-id>/workers/durable_objects/namespacesCompressionStream https://caniuse.com/mdn-api_compressionstreammoduleFileExtensions Jest option? if you are, make sure you've got "json" included in that arrayDurableObjectId isnt exported?import { DurableObjectId } from "miniflare/dist/modules/do", the next version will make it much easier to use individual components like thissetTimeout and they pretty much always fire, but not if the object needs to be destroyed (colo goes down, or service upgrade) or runs out of runtime. For the latter, I believe the cloudflare team said that they are working on an update to ensure they will fire more consistently in the future (search the scrollback), but no public docs for that yet.setTimeout for the 99% case, but also store the timer in state and have a cron that runs every minute as a fallback, the cron is guaranteed to run even if the DO is recreatedstate.storageJust curious if this is production readyDepends on your production needs. For a game, maybe. Officially, it's not even GA yet, so not production-ready from an official point of view. Not even billed yet!
I think this will be a huge game changer for writing online services and games.I agree, as long as you're fine with tying your architecture to cloudflare
state.storage, it is there if you need it, but you can have your object live only in memory if you want.Test suite failed to run
Cannot find module '../generated/offsets' from '../../node_modules/tz-offset/src/tz-offset.js'
Require stack:
C:/dev/me/tinkering-with-durable-objects/node_modules/tz-offset/src/tz-offset.js
C:/dev/me/tinkering-with-durable-objects/node_modules/node-cron/src/scheduled-task.js
C:/dev/me/tinkering-with-durable-objects/node_modules/node-cron/src/node-cron.js
C:/dev/me/tinkering-with-durable-objects/node_modules/miniflare/dist/index.js
src/projections/ProjectionDurableObject.test.ts