Skip to content
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

Maybe restart disrespects a stopped event loop #144

Closed
SimonDanisch opened this issue May 24, 2017 · 7 comments
Closed

Maybe restart disrespects a stopped event loop #144

SimonDanisch opened this issue May 24, 2017 · 7 comments

Comments

@SimonDanisch
Copy link
Member

This line:
https://github.com/JuliaGizmos/Reactive.jl/blob/master/src/core.jl#L389

Will restart the event loop, even if it was manually stopped. So it basically becomes impossible to stop the event loop, since it will just restart automatically at some later point.

@JobJob
Copy link
Member

JobJob commented May 24, 2017

Hi Simon, do you by chance have some simple code that triggers this? I was under the impression that this line is the guard against that situation: https://github.com/JuliaGizmos/Reactive.jl/blob/master/src/core.jl#L379
In a notebook with these 5 cells, I get the output below each block

using Reactive

s = Signal(1)
m = map(identity, s)
push!(s, 3)
value(m)

3

Reactive.stop()
push!(s, 2)
value(m)

3
(i.e. didn't get changed to 2, implying queue runner is stopped)

Base.n_avail(Reactive._messages)

1
(the push!(s, 2) is still in the queue)

@SimonDanisch
Copy link
Member Author

It restarts as soon as you try to poll manually, which is what i wanted to have the stop for ;)

@JobJob
Copy link
Member

JobJob commented May 24, 2017

What do you mean poll manually?

@SimonDanisch
Copy link
Member Author

Running run_till_now()

@JobJob
Copy link
Member

JobJob commented May 24, 2017

Not able to reproduce that behaviour unfort. e.g. say I add these cells after the above:

Reactive.run_till_now()
value(s)

2

m3 = map(x->3x, s)

6

push!(s, 4)
value(m3)

6
(not 12)

Do you have a minimal test case?

@SimonDanisch
Copy link
Member Author

Hm I think you're right... Seems like my problem is somewhere else...

@SimonDanisch
Copy link
Member Author

found the bug: #146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants