synchronizing HTTPRequest events [solved]
Posted: Tue May 14, 2024 2:29 pm
Hi again,
due to the fact SB is running asynchronous I face the problem of synchronizing some Events. Unfortunately something like Mutex does not exist in SB.
Hopefully a SB Guru can give me an idea how to solve synchronizing.
Following my scheme:
Any Ideas ?
due to the fact SB is running asynchronous I face the problem of synchronizing some Events. Unfortunately something like Mutex does not exist in SB.
Hopefully a SB Guru can give me an idea how to solve synchronizing.
Following my scheme:
Code: Select all
procedure httprequest1callback()
;<code>
endprocedure
procedure httprequest2callback()
;<code>
endprocedure
procedure httprequest3callback()
;<code>
endprocedure
procedure GadgetEvents()
select EventGadget()
case #button
HTTPRequest(#PB_HTTP_Get,<url>,"",@httprequest1callback(),0,httpheader()) ;called first
HTTPRequest(#PB_HTTP_Get,<url>,"",@httprequest2callback(),0,httpheader()) ;should be startet after previous call has results
HTTPRequest(#PB_HTTP_Get,<url>,"",@httprequest3callback(),0,httpheader()) ;should be startet after previous call has results
endselect
endprocedure
Procedure main()
BindEvent(#PB_Event_Gadget,@GadgetEvents())
endprocedure
main()