plafer / Tissue.jl

Framework for building computational graphs that process any real time data source.
https://plafer.github.io/Tissue.jl/stable/
MIT License
2 stars 1 forks source link

If a packet is dropped on the first run of a graph, the graph just hangs. #3

Open plafer opened 3 years ago

plafer commented 3 years ago

Version: 0.2.0 Julia version: 1.6.2 To reproduce, failing test:

using Tissue
using Test
using Base.Threads: @spawn

flag_touched = false

struct Source end
Tissue.process(s::Source) = 42

struct Dropper end
Tissue.process(c::Dropper, in_num) = nothing

struct Touch end
function Tissue.process(c::Touch, in_num) 
    global flag_touched
    flag_touched = true
end

@graph G begin
    @calculator source = Source()
    @calculator dropper = Dropper()
    @calculator toucher = Touch()

    @bindstreams dropper (in_num = source)
    @bindstreams toucher (in_num = dropper)
end

g = G()
start(g)

sleep(0.5)

@test flag_touched == true