MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / Handle

Method Handle

fs/contube/http.go:91–107  ·  view source on GitHub ↗
(ctx context.Context, endpoint string, record Record)

Source from the content-addressed store, hash-verified

89}
90
91func (f *HttpTubeFactory) Handle(ctx context.Context, endpoint string, record Record) error {
92 e, ok := f.getEndpoint(endpoint)
93 if !ok {
94 return ErrEndpointNotFound
95 }
96 if e.s.Load() == stateClosed {
97 return ErrEndpointClosed
98 }
99 select {
100 case e.c <- record:
101 return nil
102 case <-ctx.Done():
103 return ctx.Err()
104 case <-e.ctx.Done():
105 return ErrEndpointClosed
106 }
107}
108
109func (f *HttpTubeFactory) NewSourceTube(ctx context.Context, config ConfigMap) (<-chan Record, error) {
110 c := httpSourceTubeConfig{}

Callers 2

GetHandleFuncMethod · 0.95
TestHttpTubeHandleRecordFunction · 0.95

Calls 2

getEndpointMethod · 0.95
LoadMethod · 0.65

Tested by 1

TestHttpTubeHandleRecordFunction · 0.76