Build C# core workers manager
The job: create workers manager component using C#
the system: financial web application (enterprise application already exists)
user: the end-user for the system
special functions: a function that required to work in background and in a different operating system process. it will be built in a separate DLL
how worker manager will work:
user will trigger a special function
worker manager copy the DLL of the special function, and any other dependencies, from the system root directory into another directory with a new ID.
then workers manager will ask the OS to run a process from this directory.
the workers manager characteristics:
– workers manager should write logs, at least to the console standard output.
– each process should be connected to the worker manager publish its status to it via Redis channel.
– workers manager should be able to monitor the cpu and memory utilization for each process.
– It should work on Linux (Ubuntu) and Windows as well without any modifications.
– configurations for max processes for each special function
– special functions configurations will be read from a specific directory and be loaded into worker memory. the worker will be listening to a special Redis channel. according to the messages that will be received from this channel, the worker will start the new process based on the function configurations. so, at any time if we want to add new function we can add just a function configuration file and the function files without modifying the workers manager code.
Example for function configuration (not exact but a vision for what it could be):
“function_name” : “archive-one-year”,
“main_dll” : “archiveOneYear.dll”,
“dependancies” : [
– a sequence/activity diagram is required
– we appreciate the understandable and simple code.