We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For Future type publisher, it send signal then send completion to the Publishers.ReceiveOn.
In Publishers.ReceiveOn:
for signal:
scheduler.schedule(options: options) { self.scheduledReceive(input) }
for completion:
scheduler.schedule(options: options) { self.scheduledReceive(completion: completion) }
but the scheduler may execute the completion command before signal, in this case, the state.subscription is nil then returned.
state.subscription
private func scheduledReceive(_ input: Input) { lock.lock() guard state.subscription != nil else { lock.unlock() return } // ... }
This result is not match expectations.
And the Apple's Combine has the same bug yet 😂.
We should promise the subscriber will always receive the signal?
Some solution code:
// for signal. lockedActions.write().safeRun({ $0.pointee.insert({ [weak self] in self?.scheduledReceive(input) }, at: 0) }) scheduler.schedule(options: options) { self.lockedActions.write().safeRun({ $0.pointee.popLast()?() }) } // for complection. lockedActions.write().safeRun({ $0.pointee.insert({ [weak self] in self?.scheduledReceive(completion: completion) }, at: 0) }) scheduler.schedule(options: options) { self.lockedActions.write().safeRun({ $0.pointee.popLast()?() }) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For Future type publisher, it send signal then send completion to the Publishers.ReceiveOn.
In Publishers.ReceiveOn:
for signal:
for completion:
but the scheduler may execute the completion command before signal, in this case, the
state.subscription
is nil then returned.This result is not match expectations.
And the Apple's Combine has the same bug yet 😂.
We should promise the subscriber will always receive the signal?
Some solution code:
The text was updated successfully, but these errors were encountered: