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

Method connect

packages/sql/mssql/test/Client.test.ts:65–80  ·  view source on GitHub ↗
(callback: (cause: unknown) => void)

Source from the content-addressed store, hash-verified

63 }
64
65 connect(callback: (cause: unknown) => void) {
66 // Resume acquisition, then emit in the same driver turn, before a forked
67 // pool listener can run. Do not install a test-only error listener.
68 Fiber.getCurrent()!.currentDispatcher.scheduleTask(() => {
69 callback(null)
70 if (state.errorAfterConnect) {
71 state.errorAfterConnect = false
72 this.closed = true
73 try {
74 this.emit("error", new Error("Connection lost - read ETIMEDOUT"))
75 } catch (error) {
76 state.emissionError = error
77 }
78 }
79 }, 0)
80 }
81
82 close() {
83 if (!this.closed) {

Callers

nothing calls this directly

Calls 3

scheduleTaskMethod · 0.65
emitMethod · 0.65
callbackFunction · 0.50

Tested by

no test coverage detected