AcUtils
A high performance abstraction layer for AccuRev
Static Public Member Functions | Static Private Member Functions | List of all members
AcUtils.AcCommand Class Reference

AccuRev command processing. More...

Static Public Member Functions

static async Task< AcResultrunAsync (string command, ICmdValidate validator=null)
 Run the AccuRev command asynchronously with non-blocking I/O. More...
 
static AcResult run (string command, ICmdValidate validator=null)
 Run the AccuRev command synchronously (blocks) on the current thread. More...
 

Static Private Member Functions

static AcCommand ()
 Initialize our task scheduler that allows no more than n tasks to execute simultaneously. More...
 

Detailed Description

AccuRev command processing.

Definition at line 138 of file AcCommand.cs.

Constructor & Destructor Documentation

static AcUtils.AcCommand.AcCommand ( )
inlinestaticprivate

Initialize our task scheduler that allows no more than n tasks to execute simultaneously.

See also
LimitedConcurrencyLevelTaskScheduler, ParallelExtensionsExtras Tour - #7 - Additional TaskSchedulers

Definition at line 150 of file AcCommand.cs.

Member Function Documentation

static AcResult AcUtils.AcCommand.run ( string  command,
ICmdValidate  validator = null 
)
inlinestatic

Run the AccuRev command synchronously (blocks) on the current thread.

Parameters
commandThe AccuRev command to run, e.g. hist -fx -p AcTools -t 453
validatorUse to change the default logic for determining if an AcUtilsException should be thrown based on AccuRev's program return value for command.
Returns
On success an AcResult object with AcResult.RetVal set to the AccuRev program return value and the command result (usually XML) in AcResult.CmdResult. Otherwise, AcResult.RetVal is minus one (-1) (default) on error.
Exceptions
AcUtilsExceptionthrown on AccuRev program invocation failure or merge/diff program error (return value two (2)).
Win32Exceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on error spawning the AccuRev process that runs the command.
InvalidOperationExceptioncaught and logged in same on failure to handle a range of exceptions.
Attention
Do not use this function for the ismember command. Instead, use AcGroups::isMember.

Definition at line 266 of file AcCommand.cs.

static async Task<AcResult> AcUtils.AcCommand.runAsync ( string  command,
ICmdValidate  validator = null 
)
inlinestatic

Run the AccuRev command asynchronously with non-blocking I/O.

To reduce the risk of the AccuRev server becoming unresponsive due to an excess of commands, the maximum number of commands that will run simultaneously for a client application is eight (8). Other commands are queued until space is available. You can override this default value by creating the environment variable ACUTILS_MAXCONCURRENT and specifying a different number, e.g. ACUTILS_MAXCONCURRENT=12.

Parameters
commandThe AccuRev command to run, e.g. hist -fx -p AcTools -t 453
validatorUse to change the default logic for determining if an AcUtilsException should be thrown based on AccuRev's program return value for command.
Returns
An AcResult object with AcResult.RetVal set to the AccuRev program return value and the command result (usually XML) in AcResult.CmdResult. Returns null if an exception occurs.
Exceptions
AcUtilsExceptionthrown on AccuRev program invocation failure or merge/diff program error (return value two (2)).
Win32Exceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on error spawning the AccuRev process that runs the command.
InvalidOperationExceptioncaught and logged in same on failure to handle a range of exceptions.
Attention
Do not use this function for the ismember command. Instead, use AcGroups::isMember.

Definition at line 184 of file AcCommand.cs.

Referenced by AcUtils.AcQuery.getAccuRevVersionAsync(), AcUtils.AcQuery.getCatFileAsync(), AcUtils.AcQuery.getElementNameAsync(), AcUtils.AcDepot.getHierarchyAsync(), AcUtils.AcQuery.getPrincipalAsync(), AcUtils.AcWorkspaces.getReferenceTreesXMLAsync(), AcUtils.AcWorkspaces.getWorkspacesXMLAsync(), AcUtils.AcGroups.initAsync(), AcUtils.AcDepot.initAsync(), AcUtils.AcSessions.initAsync(), AcUtils.AcProperties.initAsync(), AcUtils.AcRules.initAsync(), AcUtils.AcLocks.initAsync(), AcUtils.AcPermissions.initAsync(), AcUtils.AcStreams.initAsync(), AcUtils.AcUsers.initAsync(), AcUtils.AcDepots.initAsync(), AcUtils.AcUser.initGroupsListAsync(), AcUtils.AcGroups.initMembersListAsync(), AcUtils.AcLocks.lockAsync(), and AcUtils.AcLocks.unlockAsync().