What's event loop? | developer.brewmp.com What's event loop? | developer.brewmp.com

Developer

What's event loop?

Forums:

in brew api reference,

ishell_resume :
This function allows a callback to be registered with the AEE Shell. It adds the callback to the AEE Shell's list of pending operations. The AEE Shell invokes the callback function the next time the event loop is called, allowing an application or object to cooperatively multitask. If the callback has already been registered, it is cancelled (de-registered) and then re-registered.

my question :
1. What's event loop exactly?
2. If i use ishell_resume(CB) after callback_init(CB), the CB will be called immediately by AEE?
3. How can i make event loop to make my CB called?

hanseun wrote:in brew api reference,
ishell_resume :
This function allows a callback to be registered with the AEE Shell. It adds the callback to the AEE Shell's list of pending operations. The AEE Shell invokes the callback function the next time the event loop is called, allowing an application or object to cooperatively multitask. If the callback has already been registered, it is cancelled (de-registered) and then re-registered.
my question :
1. What's event loop exactly?
The event loop is managed by BREW, and is the process by which events are repeatedly pulled from the queue and dispatched (via IAPPLET_HandleEvent) to various applications. Callbacks (see AEECallback) are also queued.
hanseun wrote:2. If i use ishell_resume(CB) after callback_init(CB), the CB will be called immediately by AEE?
No. It will be called sometime later, after you have returned control to the operating system (by returning from whatever event or callback you were processing when you called ISHELL_Resume).
hanseun wrote:
3. How can i make event loop to make my CB called?
Use CALLBACK_Init, and ISHELL_Resume. Don't forget to see callback.pfnCancel to NULL as per the documentation.

hanseun wrote:in brew api reference,
ishell_resume :
This function allows a callback to be registered with the AEE Shell. It adds the callback to the AEE Shell's list of pending operations. The AEE Shell invokes the callback function the next time the event loop is called, allowing an application or object to cooperatively multitask. If the callback has already been registered, it is cancelled (de-registered) and then re-registered.
my question :
1. What's event loop exactly?
The event loop is managed by BREW, and is the process by which events are repeatedly pulled from the queue and dispatched (via IAPPLET_HandleEvent) to various applications. Callbacks (see AEECallback) are also queued.
hanseun wrote:2. If i use ishell_resume(CB) after callback_init(CB), the CB will be called immediately by AEE?
No. It will be called sometime later, after you have returned control to the operating system (by returning from whatever event or callback you were processing when you called ISHELL_Resume).
hanseun wrote:
3. How can i make event loop to make my CB called?
Use CALLBACK_Init, and ISHELL_Resume. Don't forget to see callback.pfnCancel to NULL as per the documentation.