I think it's pretty typical that we have a durable object represent some entity like a user or a ses
I think it's pretty typical that we have a durable object represent some entity like a user or a session, so we use idFromName, and then have that DO handle things for that entity.
Once I'm in the DO, however, it doesn't know the original entity id. I'm awkwardly passing in the entity id via a public init method, and then storing it in DO storage, so that when it wakes up after eviction (from a websocket message arriving or an alarm), it can "remember" its own entity id.
Are there other workarounds people are using that I'm not considering? Is there a less clunky way of the DO being aware of its own entity id? Thanks!
Once I'm in the DO, however, it doesn't know the original entity id. I'm awkwardly passing in the entity id via a public init method, and then storing it in DO storage, so that when it wakes up after eviction (from a websocket message arriving or an alarm), it can "remember" its own entity id.
Are there other workarounds people are using that I'm not considering? Is there a less clunky way of the DO being aware of its own entity id? Thanks!
