RUnning multiple Console apps from a web app

Is it possible to have multiple instances of a console app running at once from the same location? Ex: In a web app, the user is finished with their work and an email needs to be sent to them, the work of doing this is handed off to a console app. However, at the same time in a different session, another user needs an email as well, so that session tries to fire up the console app as well.

Is this possible by running the console app in the background? Or will one version of the console app have to queue requests?

Thank you.

That’s largely up to the OS you are running on and whether it allows a binary to run more than once. Linux (for instance) should allow it to run more than once.

I would suggest however making it so the app does handle a queue as well and only launch a new app if one isn’t already running. There is a little overhead in launching an app and every little bit helps when conserving cpu cycles on a server.

I’ve implemented that years ago:

  • (Web)Application sends message/order to console app “taskmanager” via socket. Taskmanager does the queuing and launches as much as worker applications (console) as needed / configured, and establishes a tcp connection with each worker application. Worker apps can exist everywhere in your network, so the concept is scalable. Communication back to the (web)application is just the other way around. I had this project, for reverse geocoding and geographic calculations, running unattended on a Win2003 server for more than 10 years.
    Think this can perfectly done in Xojo also.

Sounds like the perfect topic for a tutorial … :wink: