Example #1
0
        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;
        }
Example #2
0
        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
                });
            });
        }
Example #3
0
 public void Dispose()
 {
     ZNodeManager.Stop();
     db.Value.Dispose();
 }