Example #1
0
 public FileQueue(string inputQueue, QueueRegister queueRegister)
 {
     _inputQueue    = inputQueue;
     _queueRegister = queueRegister;
     _filesCache    = new HashSet <string>();
     _filesQueue    = new ConcurrentQueue <string>();
     _accessCounter = 0;
 }
Example #2
0
        /// <summary>
        /// Constructs the file system transport to create "queues" as subdirectories of the specified base directory.
        /// While it is apparent that <seealso cref="baseDirectory"/> must be a valid directory name, please note that
        /// <seealso cref="_inputQueue"/> must not contain any invalid path either.
        /// </summary>
        public FileSystemTransport(string baseDirectory, string inputQueue)
        {
            if (inputQueue == null)
            {
                return;
            }
            TransportHelper.EnsureQueueNameIsValid(inputQueue);
            _inputQueue = inputQueue;

            _queueRegister     = new QueueRegister(baseDirectory);
            _fileQueue         = new FileQueue(inputQueue, _queueRegister);
            _fileNameGenerator = new FileNameGenerator();
        }