I'm trying to read from an input device asynchronously. I tried the obvious

@async begin
    dev = open(STICK_INPUT_DEV)
    while true
        s = read(dev, Stick)
        if s.ev_type == EV_KEY
            println(s)
        end
    end
end

But this doesn't seem to yield correctly. The full code is available here:
https://gist.github.com/simonbyrne/70f8c944ed7a76c95b1c90a964e9d7d1

I did come across this related discussion for file IO which didn't really 
resolve the issue:
https://groups.google.com/d/topic/julia-users/kfu_hgM3bnI/discussion

What's the best way to do this?

Simon

Reply via email to