Question

I use agents in different ways, one of which consists of 100 agents monitoring website changes, and reporting back to a supervisor which I can call to spawns new monitor off, or listen to the merged changes. This is only part of my program, and I am happy with it. I now would like to spin it off and that it runs truly independently of my main program.

(Yet I would like this independent spinoff to stay as much as possible inside the langage, and use the least amount of glue code possible)

What strategies do I have here / would you recommend ?

Was it helpful?

Solution

One option for executing long-running agents is to write a Windows Service that starts with the operating system (possibly even before login) and runs in the background. Your main application can then connect to the service and communicate with it.

Running the agent in a service is quite easy. The communication between service and main application is more tricky, because they are two separate processes. The sample uses .NET Remoting, which has now been replaced with WCF, so I think that would be a thing to look at (especially if you want asynchronous communication). Alternatively, there are some F# projects that implement simple socket-based communication, which might be easier to use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top