B4J Question [b4j] WaitFor and ResumableSub on Server Handler - devpialkt (first post)    Oct 25, 2017   (1 reaction) Woww.. thank you for your quick response...
solved .. with this https://www.b4x.-subs-wait-for-sleep-in-server-handlers.81833/#content
:) B4J Question [SOLVED] Weird return from sub issue in release mode - agraham (first post)    Apr 06, 2021   (1 reaction) WaitFor depends on the presence of a message loop.
Resumable Subs (wait for / sleep) in server handlers | B4X Programming Forum B4J Code Snippet Resumable Subs (wait for / sleep) in server handlers - Erel    Feb 16, 2020   (15 reactions) Resumable subs can only work when there is a message queue.
By default, server handlers end when the Handle sub is completed. They do not create a message loop.
If you want to wait for an event then you need to call StartMessageLoop and later StopMessageLoop.
Example of handler that downloads a pa B4J Question wait for and api response - Erel (first post)    May 06, 2023   (2 reactions) Resumable Subs (wait for / sleep) in server handlers B4J Question WaitFor in Websocket - Blueforcer (first post)    Feb 08, 2019 Its a Server Websocket, not a Server handler.
Your link said it :
WebSocket handlers do have a message loop so nothing special should be done there.
Also according to the tutorial, StartMessageloop isnt necessary.
https://www.b4x.com/android/forum/threads/b4x-resumable-subs-sleep-wait-for.78601/#p B4J Question Resumable Subs (wait for / sleep) in websocket server handlers - OliverA (first post)    Aug 04, 2017   (1 reaction) Both comments relate to WebSockets:
1) Can the event sub be resumable? I don't know.
2) Can the event sub call another sub that is resumable? Yes, that's how I have been doing it in my code. B4J Tutorial [B4X] Resumable Subs - Sleep / Wait For - Erel    Feb 22, 2018   (49 reactions) Code Flow
Sub S1
Log("S1: A")
S2
Log("S1: B")
End Sub
Sub S2
Log("S2: A")
Sleep(0)
Log("S2: B")
End Sub
The output is:
S1: A
S2: A
S1: B
S2: B
54883
Whenever Sleep or Wait For are called, the current sub is paused. This is equivalent to calling Return.
Wait for a resumable sub to complete and B4J Question ABPlugin with ResumableSub - alwaysbusy (first post)    Nov 23, 2018 I think the whole resumablesub issue may have to do with StartMessageLoop. Here is a similar case:
https://www.b4x.-subs-wait-for-sleep-in-server-handlers.81833/ B4J Question Webserver with jrdc response. - Erel (first post)    Nov 10, 2020   (1 reaction) Resumable Subs (wait for / sleep) in server handlers B4J Question How to return a value?And strange questions - OliverA (first post)    Aug 27, 2023   (1 reaction) this is just a rewrite of the example of the structure code you posted above. Links to study: https://www.b4x.com/android/forum/threads/b4x-resumable-subs-that-return-values-resumablesub.82670/ https://www.b4x.-subs-wait-for-sleep-in-server-handlers.81833/ Page: 1   2   3   4   5   6   7   Powered by ColBERT |