-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
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
Fix threading issue for sending values on subjects #15
Fix threading issue for sending values on subjects #15
Conversation
Hi, @FranzBusch , I've created a pr to your branch and I think it will fix this, take a look when you have time! |
@luoxiu The CI failed, these are the same failures that I saw locally when trying to fix it. It is either that the new test is green and the synchronous backpressure one is red or the other way round. |
Ci succeeded on mac but failed on linux…… Hey, @FranzBusch , can you fix the conflicting issue? I've updated the travis's conf, let's start a new round of testing to see what will happen. |
Sure will do! |
1ea7a6a
to
9a95018
Compare
@@ -2,6 +2,14 @@ public final class Atom<Val> { | |||
|
|||
private let lock = Lock() | |||
private var val: Val | |||
|
|||
var isMutating: Bool { | |||
if lock.try() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build failed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FranzBusch Your changes to the Lock
was lost, :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah will fix it
@luoxiu We could probably add a new test target |
There is a bug in the two subjects
CurrentValueSubject
andPassthroughSubject
that the sending of new values is not synchronised. Right now this is only adding the tests to verify but I am working on implementing a fix as well, if you have input how it should be fixed please let me know.