From f20479229fe94f4e6d868a45648e1739c65e8a87 Mon Sep 17 00:00:00 2001 From: SimonDanisch Date: Wed, 22 Aug 2018 10:56:08 +0200 Subject: [PATCH] remaining depwarns --- src/Reactive.jl | 2 -- src/core.jl | 15 +++++---------- test/queue_runner.jl | 8 ++++---- test/runtests.jl | 9 +-------- test/time.jl | 2 +- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/Reactive.jl b/src/Reactive.jl index 233e3ae..090e05d 100644 --- a/src/Reactive.jl +++ b/src/Reactive.jl @@ -1,5 +1,3 @@ -__precompile__() - module Reactive include("core.jl") diff --git a/src/core.jl b/src/core.jl index c7ce870..a82e738 100644 --- a/src/core.jl +++ b/src/core.jl @@ -27,11 +27,6 @@ const edges = Vector{Int}[] #parents to children, useful for plotting graphs const node_count = Dict{String, Int}() #counts of different signals for naming -if VERSION < v"0.7.0-alpha.2" - const wait07 = wait -else - const wait07 = fetch -end if !debug_memory mutable struct Signal{T} @@ -293,7 +288,7 @@ function stop() # it seems to take a long time until the runner_task is actually finished # which can be enough to run into maybe_restart_queue with !isdone(runner_task) # see #144 - wait07(runner_task[]) + fetch(runner_task[]) end """ @@ -368,7 +363,7 @@ function run_push(pushnode::Signal, val, onerror, dont_remove_dead = false) end catch err if isa(err, InterruptException) - info("Reactive event loop was inturrupted.") + @info("Reactive event loop was inturrupted.") rethrow() else bt = catch_backtrace() @@ -418,14 +413,14 @@ function maybe_restart_queue() # will happen if `add_action!` is called while processing a push! prev_runner = current_task() @async begin - # new runner should wait07 for current runner to process the + # new runner should fetch for current runner to process the # break_loop (null) message - wait07(prev_runner) + fetch(prev_runner) runner_task[] = current_task() run() end else - wait07(runner_task[]) + fetch(runner_task[]) runner_task[] = @async run() end end diff --git a/test/queue_runner.jl b/test/queue_runner.jl index b7c2866..117657f 100644 --- a/test/queue_runner.jl +++ b/test/queue_runner.jl @@ -16,7 +16,7 @@ import Reactive: runner_task end function test_queue(expected_bcount, orig_runner) push!(a, 3) - wait07(Reactive.runner_task[]) + fetch(Reactive.runner_task[]) @test (queue_size()) == (0) @test (orig_runner) != (Reactive.runner_task[]) # we should have a new queue runner) @test (bcount) == (expected_bcount) @@ -43,7 +43,7 @@ import Reactive: runner_task end function test_queue(expected_bcount, orig_runner) push!(a, 3) - wait07(Reactive.runner_task[]) + fetch(Reactive.runner_task[]) @test (queue_size()) == (0) @test (orig_runner) != Reactive.runner_task[] # we should have a new queue runner) @test (bcount) == (expected_bcount) @@ -68,7 +68,7 @@ import Reactive: runner_task function test_queue(expected_bcount, orig_runner) push!(a, 3) push!(a, 4) - wait07(Reactive.runner_task[]) + fetch(Reactive.runner_task[]) @test (queue_size()) == (0) @test (orig_runner) != (Reactive.runner_task[]) # we should have a new queue runner) @test (bcount) == (expected_bcount*2) @@ -82,5 +82,5 @@ end if !istaskdone(Reactive.runner_task[]) Reactive.stop() - wait07(Reactive.runner_task[]) + fetch(Reactive.runner_task[]) end diff --git a/test/runtests.jl b/test/runtests.jl index fc48e92..f343b78 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,14 +1,7 @@ using Reactive -if VERSION < v"0.7.0-DEV.2005" - using Base.Test -else - using Test -end +using Test # Stop the runner task -using Reactive: wait07 - - @testset "Queue runner" begin @test (istaskdone(Reactive.runner_task[])) == (false) Reactive.stop() diff --git a/test/time.jl b/test/time.jl index d7180b4..2f80ca1 100644 --- a/test/time.jl +++ b/test/time.jl @@ -10,7 +10,7 @@ push!(b, true) step() # processing the push to b will start the fpswhen's timer - # then we wait07 for two pushes from the timer, which should take ~ 1sec + # then we fetch for two pushes from the timer, which should take ~ 1sec dt = @elapsed Reactive.run(2) push!(b, false) Reactive.run(1) # setting b to false should stop the timer