entity

command
v1.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

README

Durable entities

This sample exercises entity state and routing against a real Durable Task Scheduler task hub. It reuses one instructional flow rather than generating separate toy programs for every API option.

Run

export DTS_CONNECTION_STRING='Endpoint=http://127.0.0.1:8080;TaskHub=default;Authentication=None'
go run ./samples/entity

What it proves

  • Raw counter entity state, signals, scheduled signals, and entity queries.
  • Entity-to-entity signals and orchestrator-to-entity calls/signals.
  • Reflected entity registration with optional inputs.
  • Factory registration with captured dependencies, initialized state, and thread-safe batch cleanup.
  • Persistent bank-account objects with a locked transfer and balance invariant.
  • Entity-started orchestration with an explicit, sample-owned instance ID.

Every scenario asserts the resulting state or orchestration output. The sample prints SAMPLE_OK entity only after those assertions and cleanup succeed.

Cleanup

All orchestration IDs are declared before scheduling and then terminated/purged by exact ID. Entity state is deleted by signaling delete to the sample-owned entity keys and waiting until their state is gone. The sample never calls hub-wide entity maintenance or deletes a task hub.

Documentation

Overview

Command entity demonstrates durable entity state, calls, signals, factories, and locks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL