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

Function lose

packages/effect/src/graphql/GraphQLProtocol.ts:810–820  ·  view source on GitHub ↗
(conn: Connection, error: TransportError)

Source from the content-addressed store, hash-verified

808 )
809
810 const lose = (conn: Connection, error: TransportError) => {
811 if (conn.error !== undefined) return
812 conn.error = error
813 if (connection === conn) connection = undefined
814 Deferred.doneUnsafe(conn.ack, Effect.fail(error))
815 for (const [id, operation] of operations) {
816 if (operation.connection !== conn) continue
817 operations.delete(id)
818 Queue.failCauseUnsafe(operation.queue, Cause.fail(error))
819 }
820 }
821
822 // An invalid server message closes the connection with 4400, which is
823 // fatal for every operation on it.

Callers 2

makeWebSocketFunction · 0.85
closeFunction · 0.85

Calls 2

failMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected