DanTheGoodman
02/26/2023, 10:15 PMcrabmusket
02/26/2023, 11:28 PMLarry
02/27/2023, 1:17 AMjohtso
02/27/2023, 2:23 AMcrabmusket
02/27/2023, 3:56 AMbkyerv
02/27/2023, 12:27 PMLarry
02/27/2023, 12:54 PMLarry
02/27/2023, 12:55 PMckoeninger
02/27/2023, 4:49 PMWallslide
02/27/2023, 6:45 PMckoeninger
02/27/2023, 10:36 PMzehawk
02/28/2023, 9:12 AMSubh
02/28/2023, 10:15 AMdurable_objects
bindings as User
and Group
. Is there a way to index or filter to get all the User in a Group without putting them in Group
object?
export class Group implements DurableObject {
state: DurableObjectState;
app: Hono = new Hono();
users: Record<string, User> = {};
ckoeninger
02/28/2023, 6:57 PMSubh
02/28/2023, 7:16 PMSubh
02/28/2023, 7:18 PMckoeninger
02/28/2023, 7:44 PMSubh
03/01/2023, 11:54 AMUser
object
export class User implements DurableObject {
state: DurableObjectState;
data: {}
}
I could store data like so
await this.state.storage?.put("userData", { ...userData, });
or
this.data = userData;
When to use which one? advantages and disadvantages?Skye
03/01/2023, 11:56 AMthis.data = userData
, you won't get the persistence of putting it in storageSkye
03/01/2023, 11:57 AMSubh
03/01/2023, 12:05 PMDO ends
?Skye
03/01/2023, 12:07 PMSubh
03/01/2023, 12:42 PMjohn.spurlock
03/01/2023, 2:48 PMwaitUntil
is technically available as a member of the first arg to the DO constructor
https://developers.cloudflare.com/workers/runtime-apis/durable-objects/#durable-object-class-definition
but as mentioned there and here, it's not really necessary in DOsDanTheGoodman
03/01/2023, 2:49 PMalias
03/02/2023, 3:56 AMthis.state.blockConcurrencyWhile
in a DurableObject constructor to set up instance variables. The docs, and types specify that this should be an available function, however actually calling this function throws an unhandled error
(node:79350) UnhandledPromiseRejectionWarning: TypeError: this.state.blockConcurrencyWhile is not a function
.
Anyone familiar with this?alias
03/02/2023, 3:59 AMHardAtWork
03/02/2023, 7:06 AMLarry
03/02/2023, 2:15 PMHardAtWork
03/03/2023, 9:58 PM