private void OnPacket(RapidsConnection sendPort, JObject jsonPacket, PacketProblems warnings) { foreach (IPacketListener l in _listeners) { l.ProcessPacket(sendPort, jsonPacket, warnings); } }
private void OnError(RapidsConnection sendPort, PacketProblems errors) { foreach (IPacketListener l in _listeners) { l.ProcessError(sendPort, errors); } }
public void HandleMessage(RapidsConnection sendPort, string message) { PacketProblems problems = new PacketProblems(message); JObject jsonPacket = JsonPacket(message, problems); Validate(problems, jsonPacket); TriggerService(sendPort, problems, jsonPacket); }
private void TriggerService(RapidsConnection sendPort, PacketProblems problems, JObject jsonPacket) { if (problems.HasErrors()) { OnError(sendPort, problems); return; } IncrementRepublishCount(jsonPacket); OnPacket(sendPort, jsonPacket, problems); }
public void HandleMessage(RapidsConnection sendPort, string message) { PacketProblems problems = new PacketProblems(message); JObject jsonPacket = JsonPacket(message, problems); foreach (IValidation v in _validations) { if (problems.AreSevere()) { break; } v.Validate(jsonPacket, problems); } if (problems.HasErrors()) { OnError(sendPort, problems); } else { IncrementReadCount(jsonPacket); Packet(sendPort, jsonPacket, problems); } }
public River(RapidsConnection rapidsConnection) { rapidsConnection.Register(this); }