Jump to content
Edwin Yip

'Execution queue' options?

Recommended Posts

I discovered SimpleQueue.pas from CommonX recently, which allows you to push a bunch of procedures or closures (anonymous methods) to the queue and they'll be executed in a background thread one by one.  

 

As you can imagine, this can have a lot of uses on the server side.

 

The concept is very similar to Google cloud's Task Queue, which I read sometime ago.

 

I especially like that SimpleQueue.pas allows you to add code for execution to the queue via anon. methods, it must be very handy.

 

The issue I'm with it is that CommonX doesn't my XE4 well, and I can understand that and I'm not complaining, but just ask if there are other options of the same kind of 'code execution queue' (not data queues, that we have a bunch of excellent implementations) that I can check out?

 

PS: I know I can change the code, but since CommonX (a lot of useful things in it) has 900+ .pas files and I'm not sure how heavily SimpleQueue.pas depends on the other units, so that'll be the last option, especially I don't need to use it immediately :)

 

Thanks.

Edited by edwinyzh

Share this post


Link to post

Thanks PG, BackgroundWorker sounds exactly the solution. On the other hand, it just occurred to me that, I can just create a data queue and a long-living thread to accomplish the task :)

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×