public DLiteDatabase(Stream stream = null, BsonMapper mapper = null) { db = new Lazy<LiteDatabase>(() => { return new LiteDatabase(new MemoryStream(), mapper); }, LazyThreadSafetyMode.PublicationOnly); ZNodeManager.Start(s => Logger.Info(s)); ZNodeManager.NodeWhisperEvent += ZNodeManager_NodeWhisperEvent; }
public static void Whisper(string name, string action, IEnumerable <object> args) { var key = BuildKey(new object[] { name, action }.Concat(args)); SafeMode(key, () => { if (!RaiserIsOn(key)) { // self on OnRaiser(key); return; } ZNodeManager.Whisper(new ZNodeEntry { Command = BuildCommand(name, action), Entry = args }); }); }
public void Dispose() { ZNodeManager.Stop(); db.Value.Dispose(); }