Closed michaelficarra closed 12 years ago
The issue here is that EventMachine is not started when you interact with Bud via the tick
method. Hence, you can't use any Bud features that depend on EventMachine (including channels, loopbacks, and periodics).
It would be possible to fix this: EM would be unconditionally started, but any EM-generated events would be buffered/queued until the next call to tick
is received. Sort of weird semantics, but it would make the class of programs that work via tick
a lot closer to the programs that can be run via run_bg
or run_fg
.
Addressed via a more informative error in commit 0e18483b0d85a2ee1e55
A better error message is helpful, but IMHO the right long-term fix is to start EM when using single-stepped mode.
I agree with @neilconway. Great short term fix, but I would really expect to be able to step through a program like the one above.
This is fixed in 4ef34ee6c4cfd4573ff3.
The following code produces the error
./bud/collections.rb:736:in
.flush': undefined method
send_datagram' for nil:NilClass (NoMethodError)I suspect it is related to the loopback because I don't receive the error whenever pieces that interact with the loopback channel are commented out.
edit: simplified example