Actual cancels processing according to disposing the sequence in RxSwift

Single<Void>.create { observer in

  var wasDisposed = false

  DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
    guard wasDisposed == false else {
      print("abort")
      return
    }
    // Process something
  }

  return Disposables.create {
    wasDisposed = true
  }
}
.map { $0 }
.do(onSuccess: {})
.debug()
.subscribe()
.dispose()