kenton
02/03/2023, 3:05 PMput()
operations will almost always complete immediately. The promise returned by put()
only exists to apply backpressure -- if you write too much stuff without taking a break, you risk exceeding your memory limit, in which case put()
will start returning promises that pause for a bit. This promise actually will never indicate a failure (absent a bug in the runtime); instead, a failure resets the object before it has a chance to communicate with the rest of the world. So, any app which doesn't do excessive writes all at once can probably ignore the promise returned by put()
entirely.HardAtWork
02/03/2023, 4:48 PMaa
02/03/2023, 5:49 PMaa
02/03/2023, 5:58 PMaa
02/03/2023, 5:58 PMtim-clancy.eth
02/03/2023, 5:59 PMitty-router
.aa
02/03/2023, 6:02 PMaranchelk
02/03/2023, 6:02 PMtim-clancy.eth
02/03/2023, 6:04 PMitty-router
problem then. My environment in the entry Worker can find my DO stub, my environment within the DO cannot find the stub of the second DO.aranchelk
02/03/2023, 6:07 PMtim-clancy.eth
02/03/2023, 6:07 PMaranchelk
02/03/2023, 6:08 PMtim-clancy.eth
02/03/2023, 6:09 PMjs
.post('/close', withParams, withContent, async (
request, env
) => {
const userId = env.User.idFromName(`user`);
const user = env.User.get(userId);
Cannot read properties of undefined (reading 'User')
aranchelk
02/03/2023, 6:09 PMconstructor(state, env) {
this.state = state
this.env = env
tim-clancy.eth
02/03/2023, 6:10 PMtim-clancy.eth
02/03/2023, 6:11 PMtim-clancy.eth
02/03/2023, 6:12 PMitty-router
per-request environment variable does not carry the DO stubs within a DO but it does in the constructor. The per-request environment variable in a Worker does have the stubs.aranchelk
02/03/2023, 6:13 PM0xcaff
02/03/2023, 6:41 PM0xcaff
02/03/2023, 6:54 PMHardAtWork
02/03/2023, 8:10 PMDanTheGoodman
02/03/2023, 8:17 PMfetch()
handlerDanTheGoodman
02/03/2023, 8:18 PMDanTheGoodman
02/03/2023, 8:18 PMnew Date()
DanTheGoodman
02/03/2023, 8:18 PMnew Date().getTime()
HardAtWork
02/03/2023, 8:34 PMtrue
...DanTheGoodman
02/03/2023, 8:35 PMHardAtWork
02/03/2023, 8:38 PMjohn.spurlock
02/03/2023, 8:41 PMjohn.spurlock
02/03/2023, 8:46 PM