Documentation ¶
Index ¶
- type Manager
- func (m *Manager) GetCurrentState() (state State)
- func (m *Manager) TaskWaitForStateChange(ctx context.Context, sourceState State) (Task, bool)
- func (m *Manager) UpdateState(state State)
- func (m *Manager) WaitForStateChange(ctx context.Context, sourceState State) bool
- func (m *Manager) WaitForTasks()
- type State
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) GetCurrentState ¶
GetCurrentState return the current state of the Manager
func (*Manager) TaskWaitForStateChange ¶ added in v2.441.0
TaskWaitForStateChange is the same as `WaitForStateChange` but also return a task that can be mark as done by the upper caller to notify he is done handling the new state, done should always be called to avoid deadlock. use `WaitForTasks` to wait for task to complete
func (*Manager) UpdateState ¶
UpdateState update the current state of the Manager
func (*Manager) WaitForStateChange ¶
WaitForStateChange waits until the currentState changes from sourceState or ctx expires. A true value is returned in former case and false in latter.
func (*Manager) WaitForTasks ¶ added in v2.441.0
func (m *Manager) WaitForTasks()
WaitForTasks wait until all tasks returned by `TaskWaitForStateChange` are done
Click to show internal directories.
Click to hide internal directories.