Extensions on
Publisher
Methods
run(on:)
func run<S: Scheduler>(on scheduler: S) -> PromiseFinalizer<Self, S>
Starts the given Future without attaching a completion handler.
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
Returns
PromiseFinalizer
that can be used to handle any errors
run()
func run() -> PromiseFinalizer<Self, DispatchQueue>
Starts the given Future without attaching a completion handler.
Returns
PromiseFinalizer
that can be used to handle any errors
run(on:)
func run<S: Scheduler>(on scheduler: S)
where Failure == Never
Starts the given Future without attaching a completion handler.
This is a convenience method when Failure == Never
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
run()
func run()
where Failure == Never
Starts the given Future without attaching a completion handler.
This is a convenience method when Failure == Never
done(on:handler:)
func done<S: Scheduler>(on scheduler: S, handler: @escaping (Output) -> Void) -> PromiseFinalizer<Self, S>
Add a closure to be executed after the publisher runs on a Scheduler
and emits one single value
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
handler | @escaping (Output) -> Void |
The closure to run once the publisher has executed. This runs on |
Returns
PromiseFinalizer
that can be used to handle any errors
done(_:)
func done(_ handler: @escaping (Output) -> Void) -> PromiseFinalizer<Self, DispatchQueue>
Add a closure to be executed after the publisher runs on DispatchQueue.global()
and emits one single value
Parameters
Name | Type | Description |
---|---|---|
handler | @escaping (Output) -> Void |
The closure to run once the publisher has executed. This runs on |
Returns
PromiseFinalizer
that can be used to handle any errors.
done(on:handler:)
func done<S: Scheduler>(on scheduler: S, handler: @escaping () -> Void) -> PromiseFinalizer<Self, S>
where Output == Void
Add a closure to be executed after the publisher runs on a Scheduler
and emits one single value
This is a convenience method to simplify the use site when Output == Void
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
handler | @escaping () -> Void |
The closure to run once the publisher has executed. This runs on |
Returns
PromiseFinalizer
that can be used to handle any errors
done(_:)
func done(_ handler: @escaping () -> Void) -> PromiseFinalizer<Self, DispatchQueue>
where Output == Void
Add a closure to be executed after the publisher runs on DispatchQueue.global()
and emits one single value
This is a convenience method to simplify the use site when Output == Void
Parameters
Name | Type | Description |
---|---|---|
handler | @escaping () -> Void |
The closure to run once the publisher has executed. This runs on |
Returns
PromiseFinalizer
that can be used to handle any errors.
done(on:handler:)
func done<S: Scheduler>(on scheduler: S, handler: @escaping (Output) -> Void)
where Failure == Never
Add a closure to be executed after the publisher runs on a Scheduler
and emits one single value
This is a convenience method when Failure == Never
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
handler | @escaping (Output) -> Void |
The closure to run once the publisher has executed. This runs on |
done(_:)
func done(_ handler: @escaping (Output) -> Void)
where Failure == Never
Add a closure to be executed after the publisher runs on DispatchQueue.global()
and emits one single value
This is a convenience method when Failure == Never
Parameters
Name | Type | Description |
---|---|---|
handler | @escaping (Output) -> Void |
The closure to run once the publisher has executed. This runs on |
done(on:handler:)
func done<S: Scheduler>(on scheduler: S, handler: @escaping () -> Void)
where Output == Void, Failure == Never
Add a closure to be executed after the publisher runs on a Scheduler
and emits one single value
This is a convenience method when Output == Void
and Failure == Never
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
handler | @escaping () -> Void |
The closure to run once the publisher has executed. This runs on |
done(_:)
func done(_ handler: @escaping () -> Void)
where Output == Void, Failure == Never
Add a closure to be executed after the publisher runs on DispatchQueue.global()
and emits one single value
This is a convenience method when Output == Void
and Failure == Never
Parameters
Name | Type | Description |
---|---|---|
handler | @escaping () -> Void |
The closure to run once the publisher has executed. This runs on |
then(on:handler:)
func then<P: Publisher, S: Scheduler>(on scheduler: S, handler: @escaping (Output) -> P) -> Publishers.SubscribeOn<Publishers.FlatMap<P, Self>, S>
Add a closure to be executed after the publisher runs on a Scheduler
, and then return another publisher to run afterwards.
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
handler | @escaping (Output) -> P |
The closure to run once the publisher has executed. Returns a new |
Returns
Publisher
that can be subscribed to
then(_:)
func then<P: Publisher>(_ handler: @escaping (Output) -> P) -> Publishers.FlatMap<P, Self>
Add a closure to be executed after the publisher runs on a Scheduler
, and then return another publisher to run afterwards.
Parameters
Name | Type | Description |
---|---|---|
handler | @escaping (Output) -> P |
The closure to run once the publisher has executed. Returns a new |
Returns
Publisher
that can be subscribed to
then(on:handler:)
func then<P: Publisher, S: Scheduler>(on scheduler: S, handler: @escaping () -> P) -> Publishers.SubscribeOn<Publishers.FlatMap<P, Self>, S>
where Output == Void
Add a closure to be executed after the publisher runs on a Scheduler
, and then return another publisher to run afterwards.
This is a convenience method to simplify the use site when Output == Void
Parameters
Name | Type | Description |
---|---|---|
scheduler | S |
|
handler | @escaping () -> P |
The closure to run once the publisher has executed. Returns a new |
Returns
Publisher
that can be subscribed to
then(_:)
func then<P: Publisher>(_ handler: @escaping () -> P) -> Publishers.FlatMap<P, Self>
where Output == Void
Add a closure to be executed after the publisher runs on a Scheduler
, and then return another publisher to run afterwards.
This is a convenience method to simplify the use site when Output == Void
Parameters
Name | Type | Description |
---|---|---|
handler | @escaping () -> P |
The closure to run once the publisher has executed. Returns a new |
Returns
Publisher
that can be subscribed to