public ReliableBackgroundOperations(
            GVFSContext context,
            Func <CallbackResult> preCallback,
            Func <TBackgroundOperation, CallbackResult> callback,
            Func <CallbackResult> postCallback,
            string databaseName)
        {
            this.acquisitionLock = new ReaderWriterLockSlim();
            this.persistence     = new PersistentDictionary <Guid, TBackgroundOperation>(
                Path.Combine(context.Enlistment.DotGVFSRoot, databaseName));

            this.backgroundOperations = new ConcurrentQueue <TBackgroundOperation>();
            this.wakeUpThread         = new AutoResetEvent(true);

            this.context      = context;
            this.preCallback  = preCallback;
            this.callback     = callback;
            this.postCallback = postCallback;
        }
Ejemplo n.º 2
0
        public ReliableBackgroundOperations(
            GVFSContext context,
            Func <CallbackResult> preCallback,
            Func <TBackgroundOperation, CallbackResult> callback,
            Func <CallbackResult> postCallback,
            string databaseName)
        {
            this.persistence = new PersistentDictionary <long, TBackgroundOperation>(
                Path.Combine(context.Enlistment.DotGVFSRoot, databaseName));

            this.backgroundOperations = new ConcurrentQueue <TBackgroundOperation>();
            this.wakeUpThread         = new AutoResetEvent(true);

            this.context         = context;
            this.preCallback     = preCallback;
            this.callback        = callback;
            this.postCallback    = postCallback;
            this.lastOperationId = UnassignedOperationId;

            // Enqueue saved oeprations here in the constructor to ensure that this.lastOperationId is
            // set properly before any new operations are queued
            this.EnqueueSavedOperations();
        }
Ejemplo n.º 3
0
 public abstract bool TryInstallGitCommandHooks(GVFSContext context, string executingDirectory, string hookName, string commandHookPath, out string errorMessage);
Ejemplo n.º 4
0
 public GitStatusCache(GVFSContext context, GitStatusCacheConfig config)
     : this(context, config.BackoffTime)
 {
 }