Instance Method

breakpoint(receiveSubscription:receiveOutput:receiveCompletion:)

Raises a debugger signal when a provided closure needs to stop the process in the debugger.

Declaration

func breakpoint(receiveSubscription: ((Subscription) -> Bool)? = nil, receiveOutput: ((Output) -> Bool)? = nil, receiveCompletion: ((Subscribers.Completion<Failure>) -> Bool)? = nil) -> Publishers.Breakpoint<Record<Output, Failure>>

Parameters

receiveSubscription

A closure that executes when when the publisher receives a subscription. Return true from this closure to raise SIGTRAP, or false to continue.

receiveOutput

A closure that executes when when the publisher receives a value. Return true from this closure to raise SIGTRAP, or false to continue.

receiveCompletion

A closure that executes when when the publisher receives a completion. Return true from this closure to raise SIGTRAP, or false to continue.

Return Value

A publisher that raises a debugger signal when one of the provided closures returns true.

Discussion

When any of the provided closures returns true, this publisher raises the SIGTRAP signal to stop the process in the debugger. Otherwise, this publisher passes through values and completions as-is.