当前位置: 首页>>代码示例>>C#>>正文


C# IOperationLock类代码示例

本文整理汇总了C#中IOperationLock的典型用法代码示例。如果您正苦于以下问题:C# IOperationLock类的具体用法?C# IOperationLock怎么用?C# IOperationLock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IOperationLock类属于命名空间,在下文中一共展示了IOperationLock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Tracer

 public Tracer(IFileSystem fileSystem, string path, TraceLevel level, IOperationLock traceLock)
 {
     _fileSystem = fileSystem;
     _path = path;
     _level = level;
     _traceLock = traceLock;
 }
开发者ID:richardprice,项目名称:kudu,代码行数:7,代码来源:Tracer.cs

示例2: Open

        public static DeploymentStatusFile Open(string id, IEnvironment environment, IAnalytics analytics, IOperationLock statusLock)
        {
            return statusLock.LockOperation(() =>
            {
                string path = Path.Combine(environment.DeploymentsPath, id, StatusFile);

                if (!FileSystemHelpers.FileExists(path))
                {
                    return null;
                }

                try
                {
                    XDocument document = null;
                    using (var stream = FileSystemHelpers.OpenRead(path))
                    {
                        document = XDocument.Load(stream);
                    }

                    return new DeploymentStatusFile(id, environment, statusLock, document);
                }
                catch (Exception ex)
                {
                    // in the scenario where w3wp is abruptly terminated while xml is being written,
                    // we may end up with corrupted xml.  we will handle the error and remove the problematic directory.
                    analytics.UnexpectedException(ex);

                    FileSystemHelpers.DeleteDirectorySafe(Path.GetDirectoryName(path), ignoreErrors: true);

                    // it is ok to return null as callers already handle null.
                    return null;
                }
            }, DeploymentStatusManager.LockTimeout);
        }
开发者ID:Walk4Muscle,项目名称:kudu,代码行数:34,代码来源:DeploymentStatusFile.cs

示例3: ReceivePackHandler

 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock,
                           IDeploymentManager deploymentManager,
                           IDeploymentSettingsManager settings)
     : base(tracer, gitServer, deploymentLock, deploymentManager, settings)
 {
 }
开发者ID:lookworld,项目名称:kudu,代码行数:8,代码来源:ReceivePackHandler.cs

示例4: DeploymentController

 public DeploymentController(ITracer tracer,
                             IDeploymentManager deploymentManager,
                             IOperationLock deploymentLock)
 {
     _tracer = tracer;
     _deploymentManager = deploymentManager;
     _deploymentLock = deploymentLock;
 }
开发者ID:rguerreiro,项目名称:kudu,代码行数:8,代码来源:DeploymentController.cs

示例5: ReceivePackService

 public ReceivePackService(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
开发者ID:randome,项目名称:kudu,代码行数:8,代码来源:ReceivePackService.cs

示例6: LiveScmEditorController

 public LiveScmEditorController(ITracer tracer,
                                IDeploymentManager deploymentManager,
                                IOperationLock operationLock,
                                IEnvironment environment,
                                IRepository repository) 
     : this(tracer, deploymentManager, operationLock, environment, repository, new FileSystem())
 {
 }
开发者ID:robzelt,项目名称:kudu,代码行数:8,代码来源:LiveScmEditorController.cs

示例7: DeploymentService

 public DeploymentService(ITracer tracer, 
                          IDeploymentManager deploymentManager, 
                          IOperationLock deploymentLock)
 {
     _tracer = tracer;
     _deploymentManager = deploymentManager;
     _deploymentLock = deploymentLock;
 }
开发者ID:cburgdorf,项目名称:kudu,代码行数:8,代码来源:DeploymentService.cs

示例8: RpcController

 public RpcController(ITracer tracer,
                   IGitServer gitServer,
                   IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
开发者ID:rguerreiro,项目名称:kudu,代码行数:8,代码来源:RpcController.cs

示例9: GitExeServer

 public GitExeServer(string path, IOperationLock initLock, ITraceFactory traceFactory)
 {
     _gitExe = new GitExecutable(path);
     _gitExe.SetTraceLevel(2);
     _traceFactory = traceFactory;
     _repository = new GitExeRepository(path, traceFactory);
     _repository.SetTraceLevel(2);
     _initLock = initLock;
 }
开发者ID:loudej,项目名称:kudu,代码行数:9,代码来源:GitExeServer.cs

示例10: DeploymentStatusManager

 public DeploymentStatusManager(IEnvironment environment,
                                IAnalytics analytics,
                                IOperationLock statusLock)
 {
     _environment = environment;
     _analytics = analytics;
     _statusLock = statusLock;
     _activeFile = Path.Combine(environment.DeploymentsPath, Constants.ActiveDeploymentFile);
 }
开发者ID:niknoxe,项目名称:kudu,代码行数:9,代码来源:DeploymentStatusManager.cs

示例11: ReceivePackHandler

 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock,
                           IDeploymentManager deploymentManager,
                           IRepositoryFactory repositoryFactory)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
     _repositoryFactory = repositoryFactory;
 }
开发者ID:albertjan,项目名称:kudu,代码行数:9,代码来源:ReceivePackHandler.cs

示例12: DeploymentStatusManager

 public DeploymentStatusManager(IEnvironment environment,
                                IFileSystem fileSystem,
                                IOperationLock statusLock)
 {
     _environment = environment;
     _fileSystem = fileSystem;
     _statusLock = statusLock;
     _activeFile = Path.Combine(environment.DeploymentCachePath, Constants.ActiveDeploymentFile);
 }
开发者ID:ravenboilinux,项目名称:kudu,代码行数:9,代码来源:DeploymentStatusManager.cs

示例13: RpcService

 public RpcService(ITracer tracer,
                   IGitServer gitServer,
                   IDeploymentManagerFactory deploymentManagerFactory,
                   IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _deploymentManagerFactory = deploymentManagerFactory;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
开发者ID:loudej,项目名称:kudu,代码行数:10,代码来源:RpcService.cs

示例14: DeploymentController

 public DeploymentController(ITracer tracer,
                             IDeploymentManager deploymentManager,
                             IOperationLock deploymentLock,
                             RepositoryFactory repositoryFactory)
 {
     _tracer = tracer;
     _deploymentManager = deploymentManager;
     _deploymentLock = deploymentLock;
     _repositoryFactory = repositoryFactory;
 }
开发者ID:lookworld,项目名称:kudu,代码行数:10,代码来源:DeploymentController.cs

示例15: LiveScmEditorController

 public LiveScmEditorController(ITracer tracer,
                                IOperationLock operationLock,
                                IEnvironment environment,
                                IRepository repository)
     : base(tracer, environment, environment.RepositoryPath)
 {
     _operationLock = operationLock;
     _repository = repository;
     _currentEtag = GetCurrentEtag();
 }
开发者ID:lookworld,项目名称:kudu,代码行数:10,代码来源:LiveScmEditorController.cs


注:本文中的IOperationLock类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。