MCPcopy
hub / github.com/google/gvisor / testEmitter

Struct testEmitter

pkg/eventchannel/event_test.go:28–37  ·  view source on GitHub ↗

testEmitter is an emitter that can be used in tests. It records all events emitted, and whether it has been closed.

Source from the content-addressed store, hash-verified

26// testEmitter is an emitter that can be used in tests. It records all events
27// emitted, and whether it has been closed.
28type testEmitter struct {
29 // mu protects all fields below.
30 mu sync.Mutex
31
32 // events contains all emitted events.
33 events []proto.Message
34
35 // closed records whether Close() was called.
36 closed bool
37}
38
39// Emit implements Emitter.Emit.
40func (te *testEmitter) Emit(msg proto.Message) (bool, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected