Skip to content

Instantly share code, notes, and snippets.

View NuclearFishin's full-sized avatar

Ian Warrington NuclearFishin

  • Jakarta, Indonesia
View GitHub Profile
@NuclearFishin
NuclearFishin / gist:5711723
Created June 5, 2013 05:04
My example of a "metric stream": I have a main thread doing work, and I want to push metrics asynchronously to an external server at a reasonable buffered interval. Seems like the perfect task for Rx :) ...but if I'm not careful, the main thread will tear-down the app before the subscriber finishes its work!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reactive.Subjects;
using System.Reactive.Linq;
using System.Threading;
namespace MetricPushDemo
{