public ServiceBusNotificationDequeue(ServiceBusConfiguration configuration) { _client = new Lazy <QueueClient>(() => InitializeClient(configuration)); Tweets = Observable.Defer(() => _client.Value.ObserveReceivedMessages()) .Select(message => Mapper.Value.Map <Tweet>(message)) .Publish() .RefCount(); }
public ServiceBusNotificationEnqueue(ServiceBusConfiguration configuration) => _client = new AsyncLazy <QueueClient>(() => InitializeClient(configuration));
private static QueueClient InitializeClient(ServiceBusConfiguration configureation) => new QueueClient(new ServiceBusConnectionStringBuilder(configureation.ConnectionString) { EntityPath = configureation.QueueName });