Skip to content

Commit a5c83a4

Browse files
committed
George review
1 parent e0a87fc commit a5c83a4

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

Diff for: Sources/NIOCore/EventLoop.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ extension EventLoop {
736736
/// - returns: An `EventLoopFuture` identical to the `EventLoopFuture` returned from `task`.
737737
@inlinable
738738
@preconcurrency
739-
public func flatSubmit<T: Sendable>(_ task: @escaping @Sendable () -> EventLoopFuture<T>) -> EventLoopFuture<T> { // TODO: This should take a closure that returns fresh
739+
public func flatSubmit<T: Sendable>(_ task: @escaping @Sendable () -> EventLoopFuture<T>) -> EventLoopFuture<T> {
740740
self.submit(task).flatMap { $0 }
741741
}
742742

Diff for: Sources/NIOCore/EventLoopFuture.swift

-49
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,6 @@ public struct EventLoopPromise<Value> {
184184
self._resolve(value: .success(value))
185185
}
186186

187-
/// Deliver a successful result to the associated `EventLoopFuture<Value>` object.
188-
///
189-
/// - Note: The call to this method must happen on the same event loop as this promise was created from.
190-
///
191-
/// - parameters:
192-
/// - eventLoopBoundValue: The successful result of the operation.
193-
@inlinable
194-
public func succeed(eventLoopBoundValue: Value) {
195-
self._resolve(eventLoopBoundResult: .success(eventLoopBoundValue))
196-
}
197-
198187
/// Deliver an error to the associated `EventLoopFuture<Value>` object.
199188
///
200189
/// - parameters:
@@ -247,27 +236,6 @@ public struct EventLoopPromise<Value> {
247236
self._resolve(value: result)
248237
}
249238

250-
/// Complete the promise with the passed in `Result<Value, Error>`.
251-
///
252-
/// This method is equivalent to invoking:
253-
/// ```
254-
/// switch result {
255-
/// case .success(let value):
256-
/// promise.succeed(value)
257-
/// case .failure(let error):
258-
/// promise.fail(error)
259-
/// }
260-
/// ```
261-
///
262-
/// - Note: The call to this method must happen on the same event loop as this promise was created from.
263-
///
264-
/// - parameters:
265-
/// - result: The result which will be used to succeed or fail this promise.
266-
@inlinable
267-
public func completeWith(eventLoopBoundResult: Result<Value, Error>) {
268-
self._resolve(eventLoopBoundResult: eventLoopBoundResult)
269-
}
270-
271239
/// Fire the associated `EventLoopFuture` on the appropriate event loop.
272240
///
273241
/// This method provides the primary difference between the `EventLoopPromise` and most
@@ -287,23 +255,6 @@ public struct EventLoopPromise<Value> {
287255
}
288256
}
289257

290-
/// Fire the associated `EventLoopFuture` on the appropriate event loop.
291-
///
292-
/// This method provides the primary difference between the `EventLoopPromise` and most
293-
/// other `Promise` implementations: specifically, all callbacks fire on the `EventLoop`
294-
/// that was used to create the promise.
295-
///
296-
/// - Note: The call to this method must happen on the same event loop as this promise was created from.
297-
///
298-
/// - parameters:
299-
/// - value: The value to fire the future with.
300-
@inlinable
301-
internal func _resolve(eventLoopBoundResult: Result<Value, Error>) {
302-
self.futureResult.eventLoop.assertInEventLoop()
303-
304-
self._setValue(value: eventLoopBoundResult)._run()
305-
}
306-
307258
/// Set the future result and get the associated callbacks.
308259
///
309260
/// - parameters:

0 commit comments

Comments
 (0)