public DefaultScheduler(FileSystemServiceBase fileSystemService)
        {
            _fileSystemService = fileSystemService;
            _responseChannel   =
                Channel.CreateBounded <ValueTuple <IORequest, TaskCompletionSource <IOResponse> > >(
                    new BoundedChannelOptions(100)
            {
                AllowSynchronousContinuations = false,
                FullMode     = BoundedChannelFullMode.Wait,
                SingleReader = true,
                SingleWriter = false
            });

            _readerTask = new Task(Reader, CancellationToken.None, TaskCreationOptions.LongRunning);
            _readerTask.Start();
        }
Beispiel #2
0
        public DefaultScheduler(FileSystemServiceBase fileSystemService)
        {
            _fileSystemService = fileSystemService;
            _responseChannel   =
                Channel.CreateBounded <ValueTuple <IORequest, TaskCompletionSource <IOResponse> > >(
                    new BoundedChannelOptions(100)
            {
                AllowSynchronousContinuations = false,
                FullMode     = BoundedChannelFullMode.Wait,
                SingleReader = true,
                SingleWriter = false
            });

            var reader = _responseChannel.Reader;

            Task.Run(Reader);
        }