protected static void HandleAtomic(AtomicMessage msg, SimpleMessageSender sender, IAtomicWriter<unit, int> arg3) { var count = arg3.AddOrUpdate(unit.it, () => 1, i => i + 1); if (count > 2) { sender.SendBatch(new object[] {}, e => e.AddString("ok")); return; } sender.SendOne(new AtomicMessage()); }
protected static void HandleNuclear(NuclearMessage msg, SimpleMessageSender sender, NuclearStorage storage) { var count = storage.AddOrUpdateSingleton(() => 1, i => i + 1); if (count >= 2) { sender.SendBatch(new object[] {}, e => e.AddString("ok")); return; } sender.SendOne(new NuclearMessage()); }