MCPcopy Create free account
hub / github.com/Effect-TS/effect / handoffStateMatch

Function handoffStateMatch

packages/effect/src/internal/stream/handoff.ts:76–90  ·  view source on GitHub ↗
(
  onEmpty: (notifyConsumer: Deferred.Deferred<void>) => Z,
  onFull: (value: A, notifyProducer: Deferred.Deferred<void>) => Z
)

Source from the content-addressed store, hash-verified

74
75/** @internal */
76const handoffStateMatch = <A, Z>(
77 onEmpty: (notifyConsumer: Deferred.Deferred<void>) => Z,
78 onFull: (value: A, notifyProducer: Deferred.Deferred<void>) => Z
79) => {
80 return (self: Handoff.State<A>): Z => {
81 switch (self._tag) {
82 case OP_HANDOFF_STATE_EMPTY: {
83 return onEmpty(self.notifyConsumer)
84 }
85 case OP_HANDOFF_STATE_FULL: {
86 return onFull(self.value, self.notifyProducer)
87 }
88 }
89 }
90}
91
92const handoffVariance = {
93 /* c8 ignore next */

Callers 2

handoff.tsFile · 0.85
takeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…