Skip to content

Commit

Permalink
feat(machine): add NoOpTracer for embedding (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
pancsta committed Jul 10, 2024
1 parent 7427ca0 commit 01ab46e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/machine/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,25 @@ type Tracer interface {
QueueEnd(machine *Machine)
}

// NoOpTracer is a no-op implementation of Tracer, used for embedding.
type NoOpTracer struct{}

func (t *NoOpTracer) TransitionInit(transition *Transition) {}
func (t *NoOpTracer) TransitionEnd(transition *Transition) {}
func (t *NoOpTracer) HandlerStart(
transition *Transition, emitter string, handler string) {
}

func (t *NoOpTracer) HandlerEnd(
transition *Transition, emitter string, handler string) {
}
func (t *NoOpTracer) End() {}
func (t *NoOpTracer) MachineInit(mach *Machine) {}
func (t *NoOpTracer) MachineDispose(machID string) {}
func (t *NoOpTracer) NewSubmachine(parent, mach *Machine) {}
func (t *NoOpTracer) QueueEnd(machine *Machine) {}
func (t *NoOpTracer) Inheritable() bool { return false }

// ///////////////
// ///// events, when, emitters
// ///////////////
Expand Down

0 comments on commit 01ab46e

Please sign in to comment.