Documentation ¶
Overview ¶
Package `pingregistrywf` implements the ping-registry ephemeral workflow, which gathers pings from the daemons that watch a registry. The workflow illustrates how to implement a workflow that requires coordination between multiple servers and an admin.
Workflow Events ¶
An admin uses `nogfsoctl ping-registry begin` to initialized the workflow with `WorkflowEvent_EV_FSO_PING_REGISTRY_STARTED` on the workflow and a corresponding `WorkflowEvent_EV_FSO_PING_REGISTRY_STARTED` on the ephemeral workflow index.
The Nogfsostad servers that watch the registry observe the workflow, and each of them posts a specified number of `WorkflowEvent_EV_FSO_SERVER_PINGED`.
Nogfsoregd observes the workflow and posts a specified number of `WorkflowEvent_EV_FSO_SERVER_PINGED`. It then waits until the workflow deadline and summarizes the pings in a `WorkflowEvent_EV_FSO_SERVER_PINGS_GATHERED`.
An admin uses `nogfsoctl ping-registry commit` to complete the workflow with `WorkflowEvent_EV_FSO_PING_REGISTRY_COMPLETED`, followed by `WorkflowEvent_EV_FSO_PING_REGISTRY_COMPLETED` on the workflow index, followed by a final `WorkflowEvent_EV_FSO_PING_REGISTRY_COMMITTED` on the workflow.
The final workflow event has no observable side effect. Its only purpose is to explicitly confirm termination of the workflow history. The final event may be missing if a multi-step command to complete the workflow gets interrupted.
Workflows are eventually deleted from the index with `WorkflowEvent_EV_FSO_PING_REGISTRY_DELETED` on the index. Workflows may be deleted with or without the final `WorkflowEvent_EV_FSO_PING_REGISTRY_COMMITTED` on the workflow.
Index ¶
- Variables
- func IsPackageError(err error) bool
- type Advancer
- type ArgumentNotIdempotentError
- type Behavior
- type CmdAbortExpired
- type CmdAppendPing
- type CmdCommit
- type CmdDelete
- type CmdEnd
- type CmdInit
- type CmdPostSummary
- type Event
- type EventTypeError
- type InvalidCommandError
- type JournalError
- type NewEventsError
- type State
- func (*State) AggregateState()
- func (s *State) Id() uuid.I
- func (st *State) NumPings() int
- func (st *State) Pings() []Status
- func (st *State) RegistryId() uuid.I
- func (s *State) SetVid(vid ulid.I)
- func (st *State) StateCode() StateCode
- func (st *State) SummaryStatus() Status
- func (s *State) Vid() ulid.I
- type StateCode
- type StateConflictError
- type Status
- type UninitializedError
- type Workflows
- func (r *Workflows) AbortExpired(id uuid.I, vid ulid.I) (ulid.I, error)
- func (r *Workflows) AppendPing(id uuid.I, vid ulid.I, code int32, message string) (ulid.I, error)
- func (r *Workflows) Commit(id uuid.I, vid ulid.I) (ulid.I, error)
- func (w *Workflows) Delete(id uuid.I, vid ulid.I) error
- func (r *Workflows) End(id uuid.I, vid ulid.I) (ulid.I, error)
- func (r *Workflows) FindId(id uuid.I) (*State, error)
- func (r *Workflows) Init(id uuid.I, cmd *CmdInit) (ulid.I, error)
- func (r *Workflows) PostSummary(id uuid.I, vid ulid.I, code int32, message string) (ulid.I, error)
Constants ¶
This section is empty.
Variables ¶
var NoVC = events.NoVC
var RetryNoVC = events.RetryNoVC
Functions ¶
func IsPackageError ¶
Types ¶
type Advancer ¶
type Advancer struct {
// contains filtered or unexported fields
}
The bools indicate which part of the state has been duplicated.
type ArgumentNotIdempotentError ¶
type ArgumentNotIdempotentError struct {
Arg string
}
func (*ArgumentNotIdempotentError) Error ¶
func (err *ArgumentNotIdempotentError) Error() string
type CmdAbortExpired ¶
type CmdAbortExpired struct{}
func (*CmdAbortExpired) AggregateCommand ¶
func (*CmdAbortExpired) AggregateCommand()
type CmdAppendPing ¶
func (*CmdAppendPing) AggregateCommand ¶
func (*CmdAppendPing) AggregateCommand()
type CmdCommit ¶
type CmdCommit struct{}
func (*CmdCommit) AggregateCommand ¶
func (*CmdCommit) AggregateCommand()
type CmdDelete ¶
type CmdDelete struct{}
func (*CmdDelete) AggregateCommand ¶
func (*CmdDelete) AggregateCommand()
type CmdEnd ¶
type CmdEnd struct{}
func (*CmdEnd) AggregateCommand ¶
func (*CmdEnd) AggregateCommand()
type CmdInit ¶
func (*CmdInit) AggregateCommand ¶
func (*CmdInit) AggregateCommand()
type CmdPostSummary ¶
func (*CmdPostSummary) AggregateCommand ¶
func (*CmdPostSummary) AggregateCommand()
type Event ¶
func (*Event) UnmarshalProto ¶
type EventTypeError ¶
type EventTypeError struct{}
func (*EventTypeError) Error ¶
func (err *EventTypeError) Error() string
type InvalidCommandError ¶
type InvalidCommandError struct{}
func (*InvalidCommandError) Error ¶
func (err *InvalidCommandError) Error() string
type JournalError ¶
type JournalError struct {
Err error
}
func (*JournalError) Error ¶
func (err *JournalError) Error() string
func (*JournalError) Unwrap ¶
func (err *JournalError) Unwrap() error
type NewEventsError ¶
type NewEventsError struct {
Err error
}
func (*NewEventsError) Error ¶
func (err *NewEventsError) Error() string
func (*NewEventsError) Unwrap ¶
func (err *NewEventsError) Unwrap() error
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) AggregateState ¶
func (*State) AggregateState()
func (*State) RegistryId ¶
func (*State) SummaryStatus ¶
type StateConflictError ¶
type StateConflictError struct{}
func (*StateConflictError) Error ¶
func (err *StateConflictError) Error() string
type UninitializedError ¶
type UninitializedError struct{}
func (*UninitializedError) Error ¶
func (err *UninitializedError) Error() string
type Workflows ¶
type Workflows struct {
// contains filtered or unexported fields
}