Unsmart | Tech debt
01/18/2023, 7:53 PMLyr
01/18/2023, 7:53 PMLyr
01/18/2023, 7:54 PMUnsmart | Tech debt
01/18/2023, 7:54 PMUnsmart | Tech debt
01/18/2023, 7:56 PMLyr
01/18/2023, 7:58 PMUnsmart | Tech debt
01/18/2023, 8:02 PMLyr
01/18/2023, 8:45 PMjohn.spurlock
01/18/2023, 9:38 PMUnsmart | Tech debt
01/18/2023, 10:48 PMbrett
01/18/2023, 11:06 PMUnsmart | Tech debt
01/18/2023, 11:07 PMbrett
01/18/2023, 11:09 PMbrett
01/18/2023, 11:10 PMUnsmart | Tech debt
01/18/2023, 11:10 PMjohn.spurlock
01/19/2023, 2:33 PM2023-01-19 14:27:19Z
Error: Durable Object namespace binding cannot communicate with other nodes.
ckoeninger
01/19/2023, 3:03 PMckoeninger
01/19/2023, 3:16 PMrozenmd
01/19/2023, 5:41 PMnpm install -D wrangler@beta
- patch notes: https://github.com/cloudflare/wrangler2/pull/2561brett
01/20/2023, 4:26 PMUnsmart | Tech debt
01/20/2023, 4:27 PMGiggiux
01/22/2023, 12:11 AMput
"write buffer behavior" notice in the docs, and the durable-objects-easy-fast-correct-choose-three/
blog post, is that if the in message handler function I have some await this.state.storage.get(...)
at the beginning and at the end some await this.state.storage.put(...)
at the end of the function, it will essentially behave as a FIFO queue for the messages, waiting for the whole message processing to complete, then continuing to the next one.
Am I assuming this wrong and that doesn't work as I expect using WebSocket messages?Giggiux
01/22/2023, 12:11 AMjs
webSocket.addEventListener("message", async msg => {
if (!this.randomObject) {
this.randomObject = new RandomObject(fileName, this.env);
}
})
the new RandomObject(...)
part would run only on the first message received, then it would store the variable in the active DO memory (not storage) and would never be called again.
While what I'm getting is that the actual "sync" of this variable is not instantaneous.
Is it possible that the DO runs some functions in parallel and not as it was a single threaded process?HardAtWork
01/22/2023, 6:02 AMGiggiux
01/22/2023, 11:45 AMUnsmart | Tech debt
01/22/2023, 6:44 PMGiggiux
01/22/2023, 7:02 PMfetch
calls in between storages operation, then the code executes in the order I expect.
While If I have even just one external call, then it breaks (__my__) expectation of how the storage api would work.
I underlined "my", because again, I would expect something form what I've read, but apparently I have misunderstood what's in the documentation/blog posts.
And considering the V8 concurrency model, as explained by HardAtWork in his answer, this is 100% how "normal" js would work. But it's not how I would expect it to work 😂
If you need the code for my tests, I can easily provide the DOs I've made!Giggiux
01/22/2023, 7:06 PMGiggiux
01/22/2023, 7:07 PM