MCPcopy Create free account
hub / github.com/coder/agentapi / NewEventEmitter

Function NewEventEmitter

lib/httpapi/events.go:124–138  ·  view source on GitHub ↗
(opts ...EventEmitterOption)

Source from the content-addressed store, hash-verified

122}
123
124func NewEventEmitter(opts ...EventEmitterOption) *EventEmitter {
125 e := &EventEmitter{
126 messages: make([]st.ConversationMessage, 0),
127 status: AgentStatusRunning,
128 chans: make(map[int]chan Event),
129 subscriptionBufSize: defaultSubscriptionBufSize,
130 }
131 for _, opt := range opts {
132 opt(e)
133 }
134 if e.clock == nil {
135 e.clock = quartz.NewReal()
136 }
137 return e
138}
139
140// Assumes the caller holds the lock.
141func (e *EventEmitter) notifyChannels(eventType EventType, payload any) {

Callers 2

NewServerFunction · 0.85
TestEventEmitterFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestEventEmitterFunction · 0.68