This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
G1itcher's profile picture

Missing Events

Started by G1itcher, 25 May 2014 - 09:07 PM
G1itcher #1
Posted 25 May 2014 - 11:07 PM
What methods or library calls might cause events to fall off the event list?

So far I know of two:

sleep()
read()

are there any other situation or library call that could potentially cause an issue with missing events? (This is for a stationary computer)

Usage scenario:

I've written a program that relies on several events happening per tick. I've found that some events seems to disappear from the queue if limited to happen every x seconds or so (via monitoring delta time, not using sleep())

In this particular case, I have an event called "walkto" and an event called "step_sound", walkto is dispatched 50 times for every step_sound. I've found that in such a scenario, I rarely get the "step_sound" events to show up, even though I can see them getting queued.
Edited on 25 May 2014 - 09:32 PM
GamerNebulae #2
Posted 25 May 2014 - 11:10 PM
What methods or library calls might cause events to fall off the event list?

So far I know of two:

sleep()
read()

are there any other situation or library call that could potentially cause an issue with missing events? (This is for a stationary computer)

Could you maybe clarify your question?
TheOddByte #3
Posted 25 May 2014 - 11:16 PM
Could you maybe clarify your question?
I think he means that it clears a queued event

os.queueEvent( "key", 28 )
sleep( 0 )
print( os.pullEvent() ) --# Will wait for a key since the even queue was cleared

But I guess basically all functions that use os.pullEvent ( sleep and read does )
Edited on 25 May 2014 - 09:17 PM
G1itcher #4
Posted 25 May 2014 - 11:33 PM
What methods or library calls might cause events to fall off the event list?

So far I know of two:

sleep()
read()

are there any other situation or library call that could potentially cause an issue with missing events? (This is for a stationary computer)

Could you maybe clarify your question?

Sorry, I've updated my question with my usage scenario.

Could you maybe clarify your question?
I think he means that it clears a queued event

os.queueEvent( "key", 28 )
sleep( 0 )
print( os.pullEvent() ) --# Will wait for a key since the even queue was cleared

But I guess basically all functions that use os.pullEvent ( sleep and read does )

Is there any information on what uses os.pullEvent? I'm stopping just short of writing my own seperate event list so I don't have to deal with this issue
Edited on 25 May 2014 - 09:33 PM