-
Threading or timer functions
From
Nightfox@VERT/DIGDIST to
Digital Man on Fri Feb 4 19:17:37 2011
Hi DM -ããIn one of my JS scripts for Synchronet, there is something that I would like toãhave happen periodically. It's something that could be handled usingãJavaScript's setInterval() function, but it appears that function is notãavailable in Synchronet's JS. I looked through the documentation (jsobjs.html)ãfor something related to timers or threads but didn't see an equivalent there. ããI did see the queue class, which mentions that it's used forãinter-thread/module communications, but I didn't see any functions for runningãsomething in a separate thread. The closest I could think of, looking at theãdocs, is to use load() to load & execute another JS script in the background -ãis there a better way to do it?ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.comã
-
From
Digital Man@VERT to
Nightfox on Mon Feb 7 15:10:24 2011
Re: Threading or timer functionsã By: Nightfox to Digital Man on Fri Feb 04 2011 07:17 pmãã > Hi DM -ã >ã > In one of my JS scripts for Synchronet, there is something that I wouldã > like to have happen periodically. It's something that could be handledã > using JavaScript's setInterval() function, but it appears that function isã > not available in Synchronet's JS. I looked through the documentationã > (jsobjs.html) for something related to timers or threads but didn't see anã > equivalent there.ã > I did see the queue class, which mentions that it's used forã > inter-thread/module communications, but I didn't see any functions forã > running something in a separate thread. The closest I could think of,ã > looking at the docs, is to use load() to load & execute another JS scriptã > in the background - is there a better way to do it?ããload(true,...) is the only way to start background thread. For something toãhappen periodically, that's probably not the best way to achieve that. Instead,ãhave a main loop (e.g. watching for keyboard input or whatever is equivalentãfor your script) and have it periodically perform the desired task based on theãelapsed time.ãã digital manããSnapple "Real Fact" #67:ãThere are 18 different animal shapes in the Animal cracker zoo.ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Mon Feb 7 19:28:37 2011
Re: Threading or timer functionsã By: Digital Man to Nightfox on Mon Feb 07 2011 15:10:24ãã > load(true,...) is the only way to start background thread. For something toã > happen periodically, that's probably not the best way to achieve that. Insteã > have a main loop (e.g. watching for keyboard input or whatever is equivalentã > for your script) and have it periodically perform the desired task based on ã > elapsed time.ããThanks.ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.comã