Esempio n. 1
0
 private void InitializeQueueTasks(DotQueueAddress address)
 {
     _localPort = _portResolver.FindFreePort();
     _listenerAdapter.StartListener(_localPort);
     new Thread(() => SubscribeToQueue(_localPort)).Start();
     new Thread(ReSubscribe).Start();
     _listenerAdapter.NotificationReceived += ProcessNotification;
 }
Esempio n. 2
0
 public HttpAdapter(DotQueueAddress address, IJsonSerializer <T> serializer, IJsonSerializer <Message> messageSerializer, IApiTokenSource tokenSource = null)
 {
     _tokenSource       = tokenSource;
     _messageSerializer = messageSerializer;
     _address           = address;
     _type       = typeof(T).Name;
     _serializer = serializer;
 }
Esempio n. 3
0
 public MessageQueue(DotQueueAddress address, IApiTokenSource tokenSource = null)
 {
     _tokenSource     = tokenSource;
     _httpAdapter     = new HttpAdapter <T>(address, new JsonSerializer <T>(), new JsonSerializer <Message>(), _tokenSource);
     _listenerAdapter = new ListenerAdapter <T>();
     _portResolver    = new LocalPortResolver();
     _durationHelper  = new WaitDurationHelper();
     InitializeQueueTasks(address);
 }
Esempio n. 4
0
 internal MessageQueue(DotQueueAddress address,
                       IHttpAdapter <T> httpAdapter,
                       IListenerAdapter <T> listenerAdapter,
                       ILocalPortResolver portResolver,
                       IWaitDurationHelper durationHelper)
 {
     _durationHelper  = durationHelper;
     _portResolver    = portResolver;
     _listenerAdapter = listenerAdapter;
     _httpAdapter     = httpAdapter;
     InitializeQueueTasks(address);
 }