-
Notifications
You must be signed in to change notification settings - Fork 27
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
0.25.20 breaks asynchronous tasks in reactive code blocks #176
Comments
I think @hhaensel can look at it. Can you check if it work on master with changes helmut made for kw. Not sure I understand the error |
I know what happened. You are using a local variable in handlers which I had not thought of when I generalised the Reactive API. @app begin
@private p = @task 1+1
@in x = 0.00
@onchange isready begin
if !istaskstarted(p) || istaskdone(p)
p = @task begin
println("Task started")
while x <= 100
x = x + 1
sleep(1)
end
end
schedule(p)
end
end
end Note, that I have used |
I also enhanced @app begin
@private non_reactive p = @task 1+1
@in x = 0.00
@onchange isready begin
if !istaskstarted(p) || istaskdone(p)
p = @task begin
println("Task started")
while x <= 100
x = x + 1
sleep(1)
end
end
schedule(p)
end
end
end |
Should the official recommendation (and demos) be to always use |
I explained in detail in #159. In my eyes @reactive! mutable struct TreeDemo <: ReactiveModel
d::R{Dict{String, Any}} = deepcopy(testdict)
tree::R{Vector{Dict{Symbol, Any}}} = [dict_tree(testdict)]
tree_selected::R{String} = ""
tree_ticked::R{Vector{String}} = String[]
tree_expanded::R{Vector{String}} = String[]
end
function handlers(model)
on(model.isready) do isready
isready && push!(model)
end
model
end to @appname TreeDemo
@vars begin
d = deepcopy(testdict)
tree = [dict_tree(testdict)]
tree_selected = ""
tree_ticked = String[]
tree_expanded = String[]
end
@handlers
onchange isready begin
isready && @push
end
end |
@hhaensel did you make any change about this? Are variables non-reactive by default now? |
I have this code that runs a @task in which a counter gets increased each second. It worked in 0.25.15, but after upgrading to 0.20.20 it stops working.
this is the error I'm getting on 0.20.25 and Julia 1.8.5
The text was updated successfully, but these errors were encountered: