mirror of
https://github.com/apple/swift-nio
synced 2026-11-30 05:28:44 +00:00
Make hopTo(eventLoop:) public. (#395)
Motivation: When this method was originally introduced it was also intended as a helper for external users, but we never made it public. Modifications: Make hopTo(eventLoop:) public. Result: Users will have an easier time managing their threads.
This commit is contained in:
1 parent
6fcbfc9b75
commit
e9285c6bc8
1 file changed
+2
-2
@@ -935,7 +935,7 @@ extension EventLoopFuture {
|
||||
}
|
||||
}
|
||||
|
||||
extension EventLoopFuture {
|
||||
public extension EventLoopFuture {
|
||||
/// Returns an `EventLoopFuture` that fires when this future completes, but executes its callbacks on the
|
||||
/// target event loop instead of the original one.
|
||||
///
|
||||
@@ -947,7 +947,7 @@ extension EventLoopFuture {
|
||||
/// - parameters:
|
||||
/// - target: The `EventLoop` that the returned `EventLoopFuture` will run on.
|
||||
/// - returns: An `EventLoopFuture` whose callbacks run on `target` instead of the original loop.
|
||||
func hopTo(eventLoop target: EventLoop) -> EventLoopFuture<T> {
|
||||
public func hopTo(eventLoop target: EventLoop) -> EventLoopFuture<T> {
|
||||
if target === self.eventLoop {
|
||||
// We're already on that event loop, nothing to do here. Save an allocation.
|
||||
return self
|
||||
|
||||
Reference in new issue
Block a user