File tree 4 files changed +7
-7
lines changed
Benchmarks/Benchmarks/NIOPosixBenchmarks
4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ let benchmarks = {
101
101
102
102
benchmark. startMeasurement ( )
103
103
for _ in benchmark. scaledIterations {
104
- let handle = loop. scheduleCallback ( in: . hours( 1 ) , handler: timer)
104
+ let handle = try ! loop. scheduleCallback ( in: . hours( 1 ) , handler: timer)
105
105
}
106
106
}
107
107
}
Original file line number Diff line number Diff line change @@ -363,15 +363,15 @@ public protocol EventLoop: EventLoopGroup {
363
363
/// ``scheduleCallback(at:handler:)-5ryox`` and ``cancelScheduledCallback(_:)-1lfz0``. Failure to do so will
364
364
/// result in a runtime error.
365
365
@discardableResult
366
- func scheduleCallback( at deadline: NIODeadline , handler: some NIOScheduledCallbackHandler ) -> NIOScheduledCallback
366
+ func scheduleCallback( at deadline: NIODeadline , handler: some NIOScheduledCallbackHandler ) throws -> NIOScheduledCallback
367
367
368
368
/// Schedule a callback after given time.
369
369
///
370
370
/// - NOTE: Event loops that provide a custom scheduled callback implementation **must** implement _both_
371
371
/// ``scheduleCallback(at:handler:)-5ryox`` and ``cancelScheduledCallback(_:)-1lfz0``. Failure to do so will
372
372
/// result in a runtime error.
373
373
@discardableResult
374
- func scheduleCallback( in amount: TimeAmount , handler: some NIOScheduledCallbackHandler ) -> NIOScheduledCallback
374
+ func scheduleCallback( in amount: TimeAmount , handler: some NIOScheduledCallbackHandler ) throws -> NIOScheduledCallback
375
375
376
376
/// Cancel a scheduled callback.
377
377
///
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ extension EventLoop {
86
86
/// Default implementation of `scheduleCallback(in amount:handler:)`: calls `scheduleCallback(at deadline:handler:)`.
87
87
@discardableResult
88
88
@inlinable
89
- public func scheduleCallback( in amount: TimeAmount , handler: some NIOScheduledCallbackHandler ) -> NIOScheduledCallback {
90
- self . scheduleCallback ( at: . now( ) + amount, handler: handler)
89
+ public func scheduleCallback( in amount: TimeAmount , handler: some NIOScheduledCallbackHandler ) throws -> NIOScheduledCallback {
90
+ try self . scheduleCallback ( at: . now( ) + amount, handler: handler)
91
91
}
92
92
93
93
/// Default implementation of `cancelScheduledCallback(_:)`: only cancels callbacks scheduled by the default implementation of `scheduleCallback`.
Original file line number Diff line number Diff line change @@ -897,10 +897,10 @@ internal func assertExpression(_ body: () -> Bool) {
897
897
898
898
extension SelectableEventLoop {
899
899
@inlinable
900
- func scheduleCallback( at deadline: NIODeadline , handler: some NIOScheduledCallbackHandler ) -> NIOScheduledCallback {
900
+ func scheduleCallback( at deadline: NIODeadline , handler: some NIOScheduledCallbackHandler ) throws -> NIOScheduledCallback {
901
901
let taskID = self . scheduledTaskCounter. loadThenWrappingIncrement ( ordering: . relaxed)
902
902
let task = ScheduledTask ( id: taskID, handler, deadline)
903
- try ! self . _schedule0 ( . scheduled( task) )
903
+ try self . _schedule0 ( . scheduled( task) )
904
904
return NIOScheduledCallback ( self , id: taskID)
905
905
}
906
906
You can’t perform that action at this time.
0 commit comments