Open davidmrdavid opened 3 years ago
Hey @davidmrdavid . I just ran into a pressing need for this and was wondering: in the meantime, is there anything you could advise that would do as a workaround? It seems like there probably wouldn't be but I figured there's no harm in asking.
Hi @matthewdelaney.
Thanks for reaching out. Unfortunately, I'm not personally aware of any workarounds for this, but reaching entity feature parity is next on our list, so this feature should be coming up in the coming months.
Taking a step back, perhaps your scenario does not necessitate entity locking. Please feel free to create a new issue describing your scenario and we may be able to provide guidance on workarounds :-)
Hi @davidmrdavid, do you have any news regarding this feature? I'm facing issues on using entities as flags for my logic in orchestrators.
I realized we have some overwriting/reading on the entities when we use multiple orchestrators, making the entity state not reliable and eventually destroying our logic. Any suggestions?
We need to support the Durable Functions
lock
API that allows users to establish a critical section for serial Entity updates. I believe this would be the first OOProc PL to support this feature, so I want to make sure we're in the same page about how we plan to implement it.I imagine the API would be
yield
able, giving us an opportunity to pause the orchestrator execution if the lock cannot be readily acquired, and that it would take as argument a list of EntityIds.In other words, I expect its interface to be as follows:
Proposed syntax and usage patterns
The first, and recommended, usage pattern would be one where the lock disposal is automatically managed by some context manager, so as follows:
The second usage pattern is one where entities are locked and released manually by separate APIs
I expect we'll want to support this second option because not all OOProc PLs with necessarily have a convenient lock-disposal syntax such as Python's "with" statement.
Please let me know if y'all have any thoughts. Otherwise, I'll proceed to prioritize this for an upcoming release. Thanks!