Пример #1
0
        public async void Start()
        {
            try
            {
                error = await Open();

                if (error != null)
                {
                    errorType = ErrorType.Open;
                }
            }
            catch (Exception e)
            {
                log.LogError("Got exception opening stream " + e.ToString());
                error     = e.Message;
                errorType = ErrorType.Open;
            }

            log.LogInformation("About to await writes");

            await WriteAll();

            log.LogInformation("Writes done: setting finish");

            finished.RunSynchronously();
        }
Пример #2
0
 public void Start()
 {
     length      = -1;
     offset      = 0;
     interrupted = false;
     queue       = new BufferQueue();
     log.LogInformation("Starting read for " + Source.AbsoluteUri);
     finished = Task.Run(async() => await Worker());
 }