Skip to content

Commit 3d13d06

Browse files
committed
fix: broken ci
1 parent e0ef097 commit 3d13d06

3 files changed

Lines changed: 9 additions & 14 deletions

File tree

ffi/ffi_events.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ template enqueueOrMarkStuck(
233233
if not ffiCurrentNotifyEventEnqueued.isNil():
234234
ffiCurrentNotifyEventEnqueued()
235235

236+
template dispatchFFIEvent*(eventName: string, body: untyped) =
236237
## `body` must yield `string` / `seq[byte]`. FFI thread only: encodes into
237238
## a `c_malloc` buffer and enqueues; the event thread fans out to listeners.
238239
block:

ffi/ffi_thread.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ proc processRequest[T](
5656
## Invoked within the FFI thread to process a request coming from the FFI API consumer thread.
5757

5858
let reqId = $request[].reqId
59-
let reqIdCs = reqId.cstring # keeps reqId alive; implicit string→cstring is a warning.
59+
let reqIdCs = reqId.cstring
60+
# keeps reqId alive; implicit string→cstring is a warning.
6061

6162
let retFut =
6263
if not ctx[].registeredRequests[].contains(reqIdCs):

tests/unit/test_event_thread.nim

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ suite "event delivery is asynchronous":
130130
setupCallbackData(rsp)
131131

132132
withPool(ctx):
133-
discard addEventListener(
134-
ctx[].eventRegistry, "latch", captureThreadIdCb, addr evt
135-
)
133+
discard
134+
addEventListener(ctx[].eventRegistry, "latch", captureThreadIdCb, addr evt)
136135

137136
check sendRequestToFFIThread(
138137
ctx, CaptureFfiTidRequest.ffiNewReq(captureCb, addr rsp)
@@ -164,9 +163,7 @@ suite "FFI thread independence":
164163
setupCallbackData(rsp)
165164

166165
withPool(ctx):
167-
discard addEventListener(
168-
ctx[].eventRegistry, "latch", slowSleepCb, nil
169-
)
166+
discard addEventListener(ctx[].eventRegistry, "latch", slowSleepCb, nil)
170167

171168
check sendRequestToFFIThread(
172169
ctx, EmitLatchEvent.ffiNewReq(captureCb, addr rsp, 0)
@@ -178,8 +175,7 @@ suite "FFI thread independence":
178175
# chronos's `Moment` — std/times exports a `milliseconds` that
179176
# shadows chronos's at this generic-instantiation site.
180177
let started = Moment.now()
181-
check sendRequestToFFIThread(ctx, PingEvent.ffiNewReq(captureCb, addr rsp))
182-
.isOk()
178+
check sendRequestToFFIThread(ctx, PingEvent.ffiNewReq(captureCb, addr rsp)).isOk()
183179
waitCallback(rsp)
184180
let elapsed = Moment.now() - started
185181

@@ -212,8 +208,7 @@ when not defined(gcRefc):
212208
# Wedge long enough to cross at least one tick boundary.
213209
gBlockingEnabled.store(true)
214210
let wedgeMs =
215-
(EventThreadTickInterval + FFIHeartbeatStaleThreshold).milliseconds.int +
216-
1500
211+
(EventThreadTickInterval + FFIHeartbeatStaleThreshold).milliseconds.int + 1500
217212
check sendRequestToFFIThread(
218213
ctx, BlockingRequest.ffiNewReq(captureCb, addr rsp, wedgeMs)
219214
)
@@ -277,9 +272,7 @@ suite "queue overflow":
277272
setupCallbackData(rejected)
278273

279274
withPool(ctx):
280-
discard addEventListener(
281-
ctx[].eventRegistry, "latch", backpressureCb, addr bp
282-
)
275+
discard addEventListener(ctx[].eventRegistry, "latch", backpressureCb, addr bp)
283276
discard addEventListener(
284277
ctx[].eventRegistry, NotRespondingEventName, captureCb, addr notif
285278
)

0 commit comments

Comments
 (0)