> On Apr 20, 2018, at 11:47 AM, Tony Pollard wrote:
> 
> I’d really like to be be able to see the size of a worker queue (as David 
> Adams and others have said in the past).  In my case I want a one-shot (+1 if 
> the worker is running), which doesn’t look doable if the calling process is 
> also preemptive - unless I lob everything into the queue with a timestamp.
> 
> Why do I want this?  I want to start a sync process which takes 10 seconds or 
> so to run (an ideal candidate to run preemptively), which may be called from 
> a trigger or another preemptive process.  There may be many thousands of 
> simultaneous calls, so I want one call if the worker is not running 
> (semaphore is good enough) and one call to add just one to the queue if it is 
> running (to mop up data that has changed since the worker executed).
> 
> Having a potentially huge queue seems a waste, but I’m struggling for other 
> ideas?  Sadly I missed the Summits.

I would not worry about a queue of thousands of entries. What are you afraid 
of, running out of memory? It would be just “too much” for little old 4D?

Also, remember that it is often not necessary to “optimize” something. I would 
implement the solutions in a simple, straight forward way assuming it is no 
problem to have a queue of 5,000 items for a worker. Then test it and see if it 
is a problem. You may be pleasantly surprised that it is not an issue and all 
the worry and consideration about problems and the need to optimize were not 
needed.

Tim

*****************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
*****************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to