Skip to content

Commit

Permalink
copy long_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
BeastyBlacksmith committed Apr 26, 2024
1 parent 5d79fb9 commit 29534f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/app/callbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ function _callback!(func::Union{Function, ClientsideFunction, String}, app::Dash

check_callback(func, app, deps)

if background
long_spec = Dict(:interval => interval)
manager !== nothing && (long_spec[:manager] = manager)
progress !== nothing && (long_spec[:progress] = progress)
progress_default !== nothing && (long_spec[:progress_default] = progress_default)
running !== nothing && (long_spec[:running] = running)
cancel !== nothing && (long_spec[:cancel] = cancel)
cache_args_to_ignore !== nothing && (long_spec[:cache_args_to_ignore] = cache_args_to_ignore)
end

out_symbol = Symbol(output_string(deps))
haskey(app.callbacks, out_symbol) && error("Multiple callbacks can not target the same output. Offending output: $(out_symbol)")
callback_func = make_callback_func!(app, func, deps)
Expand All @@ -149,8 +159,7 @@ function _callback!(func::Union{Function, ClientsideFunction, String}, app::Dash
isnothing(prevent_initial_call) ?
get_setting(app, :prevent_initial_callbacks) :
prevent_initial_call,
background,
interval
background ? long_spec : background
)
)
end
Expand Down
4 changes: 2 additions & 2 deletions src/app/supporttypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ struct Callback
func ::Union{Function, ClientsideFunction}
dependencies ::CallbackDeps
prevent_initial_call ::Bool
long ::Bool
interval ::Int
# TODO: refine Any s when done
long ::Any
end

is_multi_out(cb::Callback) = cb.dependencies.multi_out == true
Expand Down

0 comments on commit 29534f0

Please sign in to comment.