Re: Event loop and http::geturl

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Event loop and http::geturl
De : et99 (at) *nospam* rocketship1.me (et99)
Groupes : comp.lang.tcl
Date : 25. Jun 2025, 09:57:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103gdlo$2lnei$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 6/25/2025 12:03 AM, et99 wrote:
On 6/24/2025 5:19 PM, et99 wrote:
>
... snip ....
It has just now occurred to me that you are running your [test1] proc as a fileevent script.  Read the vwait manual under the section:
"NESTED VWAITS BY EXAMPLE"
I use geturl synchronously with no issues. But I do a single url request and wait for it, in the main line code - NOT inside an event.
The code I presented in the prior posting is how you could use -command and get a synchronous result. It is only really useful if you were going to do something between the geturl and the wait for it to be done. Otherwise, you could just call it synchronously - but NOT inside an event, if another fileevent might trigger before the first one is done.
As you will see with the example in the manual, things have to unwind, so if your fileevents occur fast enough, they may have triggered before earlier geturl calls will have had time to unwind. The event loop works like a stack.
That's why the timestamps are output in reverse order of when the geturl was called.
I'm not sure exactly what you want to accomplish. But is sounds to me like you need to do some queuing or co-routines. I have code I wrote that does single queue with 1 or more servers using threads. I sometimes use it for just a single server to get my own queuing of events.
Unfortunately, I can't use it with tcl 9.0 because of a race condition bug with respect to package requires inside threads that has been ticketed but not yet looked into.
(sorry for so many postings :)
-e

Date Sujet#  Auteur
23 Jun 25 * Event loop and http::geturl17Jonathan Kelly
23 Jun 25 +- Re: Event loop and http::geturl1Jonathan Kelly
24 Jun 25 `* Re: Event loop and http::geturl15Rich
24 Jun 25  `* Re: Event loop and http::geturl14Jonathan Kelly
25 Jun 25   `* Re: Event loop and http::geturl13et99
25 Jun 25    `* Re: Event loop and http::geturl12et99
25 Jun 25     `* Re: Event loop and http::geturl11et99
25 Jun 25      `* Re: Event loop and http::geturl10Jonathan Kelly
25 Jun 25       `* Re: Event loop and http::geturl9Rich
26 Jun 25        `* Re: Event loop and http::geturl8et99
26 Jun 25         +* File processing (was Event loop and http::geturl)2Alan Grunwald
26 Jun 25         i`- Re: File processing (was Event loop and http::geturl)1Ralf Fassel
26 Jun 25         `* Re: Event loop and http::geturl5Rich
26 Jun 25          `* Re: Event loop and http::geturl4Jonathan Kelly
26 Jun 25           `* Re: Event loop and http::geturl3et99
27 Jun 25            `* Re: Event loop and http::geturl2Christian Gollwitzer
27 Jun 25             `- Re: Event loop and http::geturl1Ralf Fassel

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal