MCPcopy Index your code
hub / github.com/coder/coder / Send

Method Send

aibridge/intercept/eventstream/eventstream.go:165–178  ·  view source on GitHub ↗

Send enqueues an event in a non-blocking fashion, but if the channel is full then it will block.

(ctx context.Context, payload []byte)

Source from the content-addressed store, hash-verified

163// Send enqueues an event in a non-blocking fashion, but if the channel is full
164// then it will block.
165func (s *EventStream) Send(ctx context.Context, payload []byte) error {
166 // Save an unnecessary marshaling if possible.
167 select {
168 case <-ctx.Done():
169 return ctx.Err()
170 case <-s.ctx.Done():
171 return s.ctx.Err()
172 case <-s.doneCh:
173 return ErrEventStreamClosed
174 default:
175 }
176
177 return s.SendRaw(ctx, payload)
178}
179
180func (s *EventStream) SendRaw(ctx context.Context, payload []byte) error {
181 select {

Callers 3

ProcessRequestMethod · 0.95
ProcessRequestMethod · 0.95
ProcessRequestMethod · 0.95

Calls 3

SendRawMethod · 0.95
ErrMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected