public void WriteChannelValue(ProducerChannelValue value, PrismRequest.WriteChannelValueCallback cb) { try { RequestQueue.Enqueue(new PrismRequest.PrismRequestItem(PrismRequest.PrismRequestItem.PrismRequestMethod.WriteChannel, JsonConvert.SerializeObject(new PrismZmqWriteChannelReqPacket(value)), value, cb)); RouteProcessQueue(); } catch (SystemException e) { System.Diagnostics.Debug.WriteLine(e.ToString()); cb(e.ToString(), null); } }
public PrismRequestProducer(List<string> endpoints) { Context = ZmqContext.Create(); RequestWorkers = new List<PrismRequest>(); RequestQueue = new Queue<PrismRequest.PrismRequestItem>(); foreach (string endpoint in endpoints) { PrismRequest requestWorker = new PrismRequest(Context, endpoint, RequestQueue); requestWorker.Start(); RequestWorkers.Add(requestWorker); } }
public void GetChannelList(string group, PrismRequest.GetChannelListCallback cb) { try { RequestQueue.Enqueue(new PrismRequest.PrismRequestItem(PrismRequest.PrismRequestItem.PrismRequestMethod.ChannelList, JsonConvert.SerializeObject(new PrismZmqChannelListReqPacket(group)), group, cb)); RouteProcessQueue(); } catch (SystemException e) { System.Diagnostics.Debug.WriteLine(e.ToString()); cb(e.ToString(), null); } }