The dcframwork framework consists of four core dll: dcframework. dll, dcframework. master. dll, dcframework. Worker. dll, and dcframework. Client. dll.
We can see that the other three DLL libraries depend on the most basic dcframework. dll. These three DLL libraries do not depend on each other except dcframework. dll.
Dcframework. DLL provides basic and common type definitions required by the DCF framework, such as distributed task dctask and distributed computing node workernode, the Service Interface idcservice that the DC master publishes to the client, the dynamic registration/Cancellation service interface iworkerregistryservice that is released to the distributed computing node, and the iworkerservice interface that the DC worker calls back to the DC master. The definitions of these types are shown in:
Dcframework. master. DLL is the core assembly used by the DC master node. It contains three main classes: The dcmaster class is used to manage all registered DC woker nodes, it is also responsible for distributing distributed tasks to a DC woker node. dcservice is the service that the DC master node publishes to the client, while workerregistryservice is the service that the DC master node publishes to the DC woker node. The class diagram is as follows:
Dcframework. worker. DLL is the core assembly used by DC worker node. Its main types are defined as dcappdomain, which is used to encapsulate appdomain so that distributed computing tasks can run in another independent appdomain; dcjobworker is a "worker" who truly executes distributed computing tasks. It can execute tasks in the target dcappdomain or the locally created dcappdomain. Dcappdomainmanager is used to manage all non-temporary dcappdomain objects and is responsible for dispatching and calling distributed tasks. The temporary and non-temporary dcappdomain objects will be detailed in subsequent articles.
Dcframework. Client. dll is an assembly for the customer. With dcframework. Client. dll, the customer can conveniently use the deployed DCF framework instance to execute their own distributed tasks. Dcframework. client. the most core class in the DLL is dcjobdispatcher. As mentioned above, dcjobdispatcher automatically remoting connects to the DC master node, encapsulates the distributed computing task as a dctask, and submits the dctask to the DC master. All this is done automatically by dcjobdispatcher in the background. All you need to do is submit the task and wait for the returned result. The class diagram is as follows:
This article only gives a brief introduction to the basic structure of dcframework. The implementation of dcframework is much more complicated than the above descriptions. In the subsequent articles, we will go deep into each part in detail.
Finally, a complete demo source code using dcframework is provided, including master, worker, and client. You can run it first.DynamicThe results of distributed computing will be explained in detail in the next article.
Welcome to the discussion. Thank you.
Go to: dcframework dynamic distributed computing framework (00) -- sequence