Skip to content

Commit

Permalink
Improved CancellationToken interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkenso committed Oct 15, 2021
1 parent 270c48b commit 0924bb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/SwiftConvenience/Common/CancellationToken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ extension CancellationToken {
public func addChild(on queue: DispatchQueue = .global(), cancel: @escaping () -> Void) {
addChild(.init(on: queue, cancel: cancel))
}

public func attach(to parent: CancellationToken) {
parent.addChild(self)
}
}


Expand Down

0 comments on commit 0924bb5

Please sign in to comment.