-
This does not make sense, additionally there does not seem to be a queue. lua> os.queueEvent("foo", "bar")
lua> os.pullEvent("foo") -- continues to wait for a event
. |
Beta Was this translation helpful? Give feedback.
Answered by
SquidDev
Dec 9, 2024
Replies: 1 comment 5 replies
-
running the same as a script produces a different result? os.queueEvent("foo", "bar")
print(os.pullEvent("foo")) -- > foo bar is there a Time To Live? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is expected behaviour, and is because the typing at the Lua prompt causes events to be consumed from the queue. What's actually happening here is:
os.queueEvent("foo", "bar")
queues thefoo
event.lua
program callsread
, which consumes yourfoo
event and discards it.os.pullEvent("foo")
. This a dozenkey
andchar
events, whichread
also consumes.os.pullEvent("foo")
is run. The queue is now empty, so this waits forever.