-
Notifications
You must be signed in to change notification settings - Fork 14
Add support for Durable Entities #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Use specifically microsoft/durabletask-dotnet#180 but also later changes https://github.com/microsoft/durabletask-dotnet as reference to implement the durable entities feature and extensive tests. |
Co-authored-by: berndverst <[email protected]>
Co-authored-by: berndverst <[email protected]>
Co-authored-by: berndverst <[email protected]>
Please make sure all new code passes our linter flake8. Use autopep8 to format the changes for convenience. |
I'm using the .NET durabletask-dotnet reference implementation to enhance the entity features. I've analyzed PR #180 and subsequent changes to ensure the Python implementation follows the same patterns and provides equivalent functionality. Currently improving entity dispatch, context capabilities, and error handling to match the .NET reference. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: berndverst <[email protected]>
Co-authored-by: berndverst <[email protected]>
Co-authored-by: berndverst <[email protected]>
Co-authored-by: berndverst <[email protected]>
All new code now passes flake8 linting and has been formatted with autopep8. Fixed formatting issues including trailing whitespace, blank line whitespace, indentation, and removed unused variables. Commit e2cff34. |
Let's also implement entity locking. We want to add something like LockEntitiesAsync to our _RuntimeOrchestrationContext as a synchronous context manager method. The idea is that we can use the We also want comprehensive tests that demonstrate entity locking. I want to be able to ensure that an orchestration requesting an entity lock will not experience side effects by another orchestration attempting to modify the same entity. We also want to verify the lock is released properly. As always, make sure your code passes our flake8 linter check. |
Co-authored-by: berndverst <[email protected]>
Implemented entity locking functionality with the
Orchestrations can now use Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Update |
Co-authored-by: berndverst <[email protected]>
Updated docs/entities.md to mark entity locking as complete in the feature comparison table. Commit d1ccd89. |
This PR implements comprehensive support for durable entities in both
durabletask
anddurabletask-azuremanaged
packages, bringing the Python SDK to feature parity with other Durable Task SDKs.What are Durable Entities?
Durable entities are stateful objects that can maintain state across multiple operations. Each entity has a unique entity ID and can handle various operations that read and modify its state. Entities are accessed using the format
EntityType@EntityKey
(e.g.,Counter@user1
).Key Features Implemented
Entity Functions
Register entity functions that handle operations and maintain state:
Client Operations
Signal entities, query state, and manage entity storage:
Orchestration Integration
Signal entities from orchestrations:
Worker Support
Execute entity operations with proper state management and error handling.
Azure Compatibility
Azure-managed classes (
DurableTaskSchedulerClient
andDurableTaskSchedulerWorker
) automatically inherit all entity functionality through inheritance.Implementation Details
EntityContext
class provides access to entity state, operation name, and instance metadataEntityState
,EntityQuery
, andEntityQueryResult
for entity management_EntityExecutor
class for processing entity batch requestssignal_entity
method toOrchestrationContext
Testing
Example Usage
See the new durable entities example for complete usage patterns including counter entities and shopping cart entities.
Breaking Changes
None. This is a pure feature addition that maintains full backward compatibility.
Fixes #44.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
http://168.63.129.16:80/machine/
/usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs
(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.