MCPcopy Create free account
hub / github.com/sourcegraph/conc / Stream

Struct Stream

stream/stream.go:38–44  ·  view source on GitHub ↗

Stream is used to execute a stream of tasks concurrently while maintaining the order of the results. To use a stream, you submit some number of `Task`s, each of which return a callback. Each task will be executed concurrently in the stream's associated Pool, and the callbacks will be executed seque

Source from the content-addressed store, hash-verified

36// microseconds, and the overhead for each task is roughly 500ns. It should be
37// good enough for any task that requires a network call.
38type Stream struct {
39 pool pool.Pool
40 callbackerHandle conc.WaitGroup
41 queue chan callbackCh
42
43 initOnce sync.Once
44}
45
46// Task is a task that is submitted to the stream. Submitted tasks will
47// be executed concurrently. It returns a callback that will be called after

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected