Documentation ¶
Index ¶
- type Tracker
- func (t *Tracker) Kill(hash string) (stopped bool)
- func (t *Tracker) NotifyExit(hash string, exitCode int)
- func (t *Tracker) PIDReadChan(hash string) (pidReadChan <-chan int, tracked bool)
- func (t *Tracker) Track(ctx context.Context, hash string, def *integration.Definition) (context.Context, chan<- int)
- func (t *Tracker) Untrack(hash string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks integrations context while running so actions can be taken later on based on those. Integrations are identified by hash: name+args. Use cases: - command-api requests to stop an integration, for which PID and ctx cancellation are stored. - integrations run by command-api should notify their exit-code by submiting an event. In case we need to cover more cases, it'd be nice to decouple cases logic from the tracking one.
func NewTracker ¶
NewTracker creates new integrations tracker. If an "emitter" is provided then an event will be submited containing the exit code of the integration execution.
func (*Tracker) NotifyExit ¶
func (*Tracker) PIDReadChan ¶
PIDReadChan returns a PID receiver channel of an stoppable process, nil is returned when not tracked.
func (*Tracker) Track ¶
func (t *Tracker) Track(ctx context.Context, hash string, def *integration.Definition) (context.Context, chan<- int)
Track tracks (indexing by hash) an integration run alogn with its context and optionally Definition. When Definition is not provided NotifyExit method won't take any effect.