kwhitley / itty-durable

Cloudflare Durable Objects + Itty Router = shorter code
MIT License
251 stars 18 forks source link

Add "new" method to proxyDurable for an object with random id or name #29

Open maurerbot opened 1 year ago

maurerbot commented 1 year ago

Why

Sometime you just want an object and not have to think about the name

What

Have a new() method on the proxy object to generate a random DO name

maurerbot commented 1 year ago

Related: https://github.com/kwhitley/itty-durable/issues/28

nathanclevenger commented 1 year ago

Yes - I really think this should be implemented using the newUniqueId() method, as this is much faster (using a name requires a potentially round-the-world check and adds substantial latency). I've got several use cases where this and #28 are required.

@kwhitley what do you think?