MCPcopy Create free account
hub / github.com/coder/aibridge / Send

Method Send

intercept/eventstream/eventstream.go:147–160  ·  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

145// Send enqueues an event in a non-blocking fashion, but if the channel is full
146// then it will block.
147func (s *EventStream) Send(ctx context.Context, payload []byte) error {
148 // Save an unnecessary marshaling if possible.
149 select {
150 case <-ctx.Done():
151 return ctx.Err()
152 case <-s.ctx.Done():
153 return s.ctx.Err()
154 case <-s.doneCh:
155 return ErrEventStreamClosed
156 default:
157 }
158
159 return s.SendRaw(ctx, payload)
160}
161
162func (s *EventStream) SendRaw(ctx context.Context, payload []byte) error {
163 select {

Callers 3

ProcessRequestMethod · 0.95
ProcessRequestMethod · 0.95
ProcessRequestMethod · 0.95

Calls 1

SendRawMethod · 0.95

Tested by

no test coverage detected