public void Processor(CancellationToken token) { Subsriber <Message> subsriber = new Subsriber <Message>() { Interval = 1000 }; subsriber.Callback(Process, m => m != null); }
public void StartListeningForMessages() { Subsriber<Message> subsriber = new Subsriber<Message>() { Interval = 1000 }; subsriber.Callback(Process, m => m != null); }
static void Main(string[] args) { var channel = new Channel("127.0.0.1:50052", ChannelCredentials.Insecure); var subscriber = new Subsriber(new PubSub.PubSubClient(channel)); Task.Run(async() => { await subscriber.Subscribe(); }).GetAwaiter(); Console.WriteLine("Hit key to unsubscribe"); Console.ReadLine(); subscriber.Unsubscribe(); Console.WriteLine("Unsubscribed..."); Console.WriteLine("Hit key to exit..."); Console.ReadLine(); }