Skip to content

Commit

Permalink
SafeStreamCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
nitely committed Jan 29, 2025
1 parent 93a6cee commit e73d8f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hyperx/server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ proc sendHeaders*(

type StreamCallback* =
proc (stream: ClientStream): Future[void] {.closure, gcsafe.}
type SafeStreamCallback* =
proc (stream: ClientStream): Future[void] {.nimcall, gcsafe.}

proc processStreamHandler(
strm: ClientStream,
Expand Down Expand Up @@ -236,7 +238,7 @@ proc worker(ctx: ptr WorkerContext) {.thread.} =
proc run*(
hostname: string,
port: Port,
callback: StreamCallback,
callback: SafeStreamCallback,
sslCertFile = "",
sslKeyFile = "",
maxConnections = defaultMaxConns,
Expand Down

0 comments on commit e73d8f1

Please sign in to comment.