54
54
# Aggregate a signal producing an update at most once in dt seconds
55
55
function throttle_connect (dt, output, input, f, init, reinit, leading, debounce)
56
56
collected = init
57
- timer = Timer (identity, 0 ) # dummy timer to initialise
57
+ timer = Timer (identity, interval = 0 ) # dummy timer to initialise
58
58
dopush (_) = begin
59
59
push! (output, collected)
60
60
collected = reinit (collected)
@@ -75,7 +75,7 @@ function throttle_connect(dt, output, input, f, init, reinit, leading, debounce)
75
75
# prevpush is reset in dopush, so that calls via the Timer also reset it
76
76
dopush (elapsed)
77
77
else
78
- timer = Timer (dopush, dt- elapsed)
78
+ timer = Timer (dopush, interval = dt- elapsed)
79
79
end
80
80
nothing
81
81
end
@@ -122,15 +122,15 @@ function setup_next_tick(outputref, switchref, dt, wait_dt)
122
122
if value (switchref. value)
123
123
push! (outputref. value, dt)
124
124
end
125
- end , wait_dt)
125
+ end , interval = wait_dt)
126
126
end
127
127
128
128
function fpswhen_connect (rate, switch, output, name)
129
129
prev_time = time ()
130
130
dt = 1.0 / rate
131
131
outputref = WeakRef (output)
132
132
switchref = WeakRef (switch)
133
- timer = Timer (identity, 0 ) # dummy timer to initialise
133
+ timer = Timer (identity, interval = 0 ) # dummy timer to initialise
134
134
function fpswhen_runner ()
135
135
# this function will run if switch gets a new value (i.e. is "active")
136
136
# and if output is pushed to (assumed to be by the timer)
0 commit comments