Posted 16 May 2014 - 09:16 PM
I am writing a redirect object for Computercraft that will send term requests to webserver using http api in order to be processed there. But i got a little bit of logic problem.
In order to do that i need to do http.request and then yeld waiting for "http_success" or "http_failure" events - that means if there was a timer or there is any rednet message it will get "eaten" by term call - similar to how turtle movement eats events. I am trying to make it behave exactly like term api so it should not do that.
I had idea to store all events and then re-queue them after i get what i needed but that would duplicate events in parallel environment (like parallel api or multi-shell) due to queueEvent queuing them for whole chain.
Does anyone got idea how to make it act like i want it to act? As in not eat events while still yielding for needed event? Or is there no way to make it do what i need it to do?
In order to do that i need to do http.request and then yeld waiting for "http_success" or "http_failure" events - that means if there was a timer or there is any rednet message it will get "eaten" by term call - similar to how turtle movement eats events. I am trying to make it behave exactly like term api so it should not do that.
I had idea to store all events and then re-queue them after i get what i needed but that would duplicate events in parallel environment (like parallel api or multi-shell) due to queueEvent queuing them for whole chain.
Does anyone got idea how to make it act like i want it to act? As in not eat events while still yielding for needed event? Or is there no way to make it do what i need it to do?