private async void Run() { string path = @"C:\Users\nigurr.FAREAST\Desktop\sample.txt"; var bus = new DataStreamGateway(); // Automatic handler subscription bus.Subscribe <GenericTestResultParser>(); using (var fileStream = File.OpenRead(path)) { await bus.ProcessDataAsync(fileStream); } bus.Complete(); }
public static Guid Subscribe <THandler>(this DataStreamGateway bus) where THandler : ITestResultParser, new() { return(bus.Subscribe(message => new THandler().Parse(message))); }
public static Guid Subscribe(this DataStreamGateway bus, Func <Action <LogLineData> > handlerActionFactory) { return(bus.Subscribe(message => handlerActionFactory().Invoke(message))); }