datalust / seq-api

HTTP API client for Seq
https://datalust.co/seq
Apache License 2.0
80 stars 20 forks source link

WebSocket support for streaming events #16

Closed nblumhardt closed 7 years ago

nblumhardt commented 7 years ago

Tailing is now much simpler:

using (var stream =
       await connection.Events.StreamAsync<JObject>(filter: "@EventType = 0xabcd123"))
{
    var subscription = stream
            .Select(jObject => LogEventReader.ReadFromJObject(jObject))
            .Subscribe(evt => Log.Write(evt), () => cancel.Cancel());

    cancel.WaitHandle.WaitOne();
    subscription.Dispose();
}

Only compact JSON event format is currently supported by the API.

Requires Seq 3.4.5-pre or later.