void OnQueryResponse(IRubyMessage message) { try { ResponseMessage response = ResponseMessage.ParseFrom(message.Message); KeyValuePair endpoint; if (KeyValuePairs.Find(RubyStrings.kQueryResponseEndpointKey, response.ReponsesList, out endpoint)) { // create a new reporter using the informations of the found service. reporter_ = new ServiceReporter(registry_, context_, endpoint.Value); if (predicate_ != null) { reporter_.Start(period_, period_unit_); } else { reporter_.Start(period_, period_unit_, predicate_); } } } catch (Exception e) { logger_.Error( string.Format(R.Log_MethodThrowsException, "OnQueryResponse", kClassName), e); } }
public override void OnMessage(IRubyMessage request) { try { switch (request.Type) { case (int)MessageType.kStoreMetricsMessage: var metrics = StoreMetricsMessage.ParseFrom(request.Message); StoreMetrics(metrics); break; } } catch (Exception e) { logger_.Error(string.Format(S.Log_MethodThrowsException, kClassName, "Store"), e); } }