A task event is an internal record of a requested task state transition. It gives the request its own UUID, records the target state and request time, and carries the associated task. Users act on tasks rather than directly manipulating events. section 2.1
This separates desired state from observed state. The requested transition is retained as a task event in the manager’s EventDB, while TaskDB records the worker-reported state of the task. section 7.6
A minimal Go representation contains:
- ID: a UUID identifying the event. section 2.1
- State: the state the task should move toward, such as Running or Completed. section 2.1
- Timestamp: when the transition was requested. section 2.1
- Task: the task whose state is being requested. section 2.1
From request to worker
A start request can be decoded from JSON into a TaskEvent. The handler then takes the event’s Task and adds that task to the worker, returning the task in the response. A small test program also constructs an event with a new UUID, Pending state, time.Now(), and a task value before printing it. section 5.4 section 2.6
Use the lifecycle diagram to place an event’s requested state among Pending, Scheduled, Running, Completed, and Failed. section 2.1
