class %SYSTEM.ShardWorkMgr extends %SYSTEM.AbstractWorkMgrInternal class to manage distributing work to other systems in a sharded environment. This is modelled on the %SYSTEM.WorkMgr as closely as possible. To use this you first create an instance of this class, this acts as the container for the units of work you then request. Finally you wait for this work to complete or return errors.
- DS or data : All shard data nodes
- QD or compute : A set of shard compute/query nodes
- all : All shard nodes
Returns a %Status code if the work was queued correctly, note that to see if the work completed you need to call Sync() method (formerly WaitForComplete()) and check the returned %Status value for this. The remote work is run in the namespace with the same name as the current namespace when the queue is created. You pass the entry point to call in work argument. This can be either '##class(Classname).ClassMethod' or '$$entry^rtn' and it is expected to return a %Status code on completion. If you want to call a function that does not return any value on completion then prepend the class syntax with '=' such as '=##class(Classname).ClassMethod' or for calling a function do not include the '$$' for example 'entry^rtn'. The item being called may also throw exceptions in order to indicate an error happened which is trapped and converted to a %Status value to be returned in the master process. You can also pass additional arguments including arrays by reference. Note that the size of the data passed in these arguments should be kept relatively small, if there is a large amount of information that needs to be passed then put this in a global. The security context of the caller is also recorded when this function is called so it can be used when the work is executed.