Skip to content

Foundational entity runtime #142

Description

@ahmedmuhsin

Part of #141

Goal

Land the core entity runtime that every entity capability builds on. This is the prerequisite for the call, signal, query, lock, class based, and cleanup sub issues.

Scope

Programming model in task

  • A function style entity contract, the analog of durabletask-dotnet ITaskEntity.RunAsync, that runs a single operation and returns a response.
  • An entity context that reads and writes entity state and can signal entities and start orchestrations.
  • An operation type that carries the operation name, input, and state.
  • An EntityInstanceId for the name and key identity.
  • AddEntity registration on TaskRegistry, alongside the existing AddOrchestrator and AddActivity.

Batched execution runner in task

  • Run an EntityBatchRequest against a registered entity and produce an EntityBatchResult.
  • Process operations transactionally per operation, so an unhandled failure rolls back both the entity state and the messages that operation emitted.
  • Expose a load and run helper that takes an encoded EntityBatchRequest and returns an encoded EntityBatchResult, the seam a trigger replay worker uses.

Worker dispatch in StartWorkItemListener

  • Handle WorkItem.EntityRequest, run the batch, and reply with CompleteEntityTask.
  • Today this work item falls through to the unknown work item branch and is dropped.

Backend entity runtime

  • Entity state storage.
  • The entity scheduler that turns calls and signals into ordered per entity work.
  • The distributed lock machinery that critical sections build on.
  • This is the largest part. It is required for a standalone durabletask-go backend. Workers that run against an external backend such as the Functions host or DTS do not need it, they only need the programming model, runner, and dispatch above.

Reference

durabletask-dotnet TaskEntityShim for the batched transactional execution, GrpcEntityRunner.LoadAndRunAsync for the load and run seam, and DurableTaskRegistry.AddEntity for registration. The EntityBatchRequest, EntityBatchResult, OperationRequest, and OperationResult messages already exist in the protos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions