示例#1
0
        public override IEnumerable <TDataType> Snapshot(AdapterReaderQos qos, QueryParameters queryParameters)
        {
            var waitHandle = new ManualResetEvent(false);

            using (var callback = new SnapshotCallback(waitHandle))
            {
                using (
                    var subcriber = new Subscriber <TDataType>(topic, queryParameters.Partition, qos, callback.Listener,
                                                               1000))
                {
                    waitHandle.WaitOne(Constants.RequestTimeout);
                    return(callback.DataItems);
                }
            }
        }
        public Guid Subscribe(FirebasePath path, string eventName, SnapshotCallback callback, object context, bool once,
                              IEnumerable <ISubscriptionFilter> filters)
        {
            var sub = new Subscription(_app, filters)
            {
                Event    = eventName,
                Callback = callback,
                Context  = context,
                Once     = once,
                Path     = path,
            };

            if (!once)
            {
                lock (_lock)
                {
                    _subscriptions.Add(sub);
                }
            }

            _syncDb.ExecuteInitial(sub);

            return(sub.SubscriptionId);
        }
示例#3
0
        public Guid Subscribe(FirebasePath path, string eventName, SnapshotCallback callback, object context, bool once,
            IEnumerable<ISubscriptionFilter> filters)
        {
            var sub = new Subscription(_app, filters)
            {
                Event = eventName,
                Callback = callback,
                Context = context,
                Once = once,
                Path = path,
            };

            if (!once)
            {
                lock (_lock)
                {
                    _subscriptions.Add(sub);
                }
            }

            _syncDb.ExecuteInitial(sub);

            return sub.SubscriptionId;
        }
示例#4
0
 internal Guid SubscribeOnce(string eventName, FirebasePath path, SnapshotCallback callback, object context,
     IEnumerable<ISubscriptionFilter> filters, FirebaseStatusCallback cancelledCallback)
 {
     return _subscriptions.Subscribe(path, eventName, callback, context, true, filters);
 }
 public IFirebaseReadonlyQuery Once(string eventName, SnapshotCallback callback, object context,
                                    FirebaseStatusCallback cancelledCallback = null)
 {
     return(CreateQuery().Once(eventName, callback, context, cancelledCallback));
 }
示例#6
0
 internal Guid Subscribe(string eventName, FirebasePath path, SnapshotCallback callback, object context,
     IEnumerable<ISubscriptionFilter> filters)
 {
     return _subscriptions.Subscribe(path, eventName, callback, context, false, filters);
 }
示例#7
0
 internal void Fire(SnapshotCallback callback, DataSnapshot snap, object context)
 {
     _subProcessor.Add(callback, snap, context);
 }
 public IFirebaseReadonlyQuery On(string eventName, SnapshotCallback callback, object context)
 {
     return(CreateQuery().On(eventName, callback, context));
 }
示例#9
0
 public IFirebaseReadonlyQuery Once(string eventName, SnapshotCallback callback, object context,
     FirebaseStatusCallback cancelledCallback = null)
 {
     return CreateQuery().Once(eventName, callback, context, cancelledCallback);
 }
示例#10
0
 internal Guid SubscribeOnce(string eventName, FirebasePath path, SnapshotCallback callback, object context,
                             IEnumerable <ISubscriptionFilter> filters, FirebaseStatusCallback cancelledCallback)
 {
     return(_subscriptions.Subscribe(path, eventName, callback, context, true, filters));
 }
示例#11
0
 public IFirebaseReadonlyQuery On(string eventName, SnapshotCallback callback)
 {
     return On(eventName, callback, null);
 }
示例#12
0
 public IFirebaseReadonlyQuery Once(string eventName, SnapshotCallback callback,
     FirebaseStatusCallback cancelledCallback = null)
 {
     return Once(eventName, callback, null, cancelledCallback);
 }
示例#13
0
 public IFirebaseReadonlyQuery On(string eventName, SnapshotCallback callback, object context)
 {
     _queryId = _app.Subscribe(eventName, _path, callback, context, _filters);
     return(this);
 }
示例#14
0
 public IFirebaseReadonlyQuery Once(string eventName, SnapshotCallback callback,
                                    FirebaseStatusCallback cancelledCallback = null)
 {
     return(Once(eventName, callback, null, cancelledCallback));
 }
示例#15
0
 public IFirebaseReadonlyQuery On(string eventName, SnapshotCallback callback)
 {
     return(On(eventName, callback, null));
 }
 public void Add(SnapshotCallback callback, DataSnapshot snap, object context)
 {
     EnsureStarted();
     _queue.Enqueue(_token, new QueueSubscriptionEvent(callback, snap, context));
 }
示例#17
0
 public void Add(SnapshotCallback callback, DataSnapshot snap, object context)
 {
     EnsureStarted();
     _queue.Enqueue(_token, new QueueSubscriptionEvent(callback, snap, context));
 }
示例#18
0
 internal void Fire(SnapshotCallback callback, DataSnapshot snap, object context)
 {
     _subProcessor.Add(callback, snap, context);
 }
示例#19
0
 public IFirebaseReadonlyQuery On(string eventName, SnapshotCallback callback, object context)
 {
     return CreateQuery().On(eventName, callback, context);
 }
示例#20
0
 public IFirebaseReadonlyQuery Once(string eventName, SnapshotCallback callback, object context,
                                    FirebaseStatusCallback cancelledCallback = null)
 {
     _queryId = _app.SubscribeOnce(eventName, _path, callback, context, _filters, cancelledCallback);
     return(this);
 }
 public QueueSubscriptionEvent(SnapshotCallback callback, DataSnapshot snap, object context)
 {
     _callback = callback;
     _snap     = snap;
     _context  = context;
 }
示例#22
0
 public IFirebaseReadonlyQuery On(string eventName, SnapshotCallback callback, object context)
 {
     _queryId = _app.Subscribe(eventName, _path, callback, context, _filters);
     return this;
 }
示例#23
0
 public QueueSubscriptionEvent(SnapshotCallback callback, DataSnapshot snap, object context)
 {
     _callback = callback;
     _snap = snap;
     _context = context;
 }
示例#24
0
 public IFirebaseReadonlyQuery Once(string eventName, SnapshotCallback callback, object context,
     FirebaseStatusCallback cancelledCallback = null)
 {
     _queryId = _app.SubscribeOnce(eventName, _path, callback, context, _filters, cancelledCallback);
     return this;
 }
示例#25
0
 internal Guid Subscribe(string eventName, FirebasePath path, SnapshotCallback callback, object context,
                         IEnumerable <ISubscriptionFilter> filters)
 {
     return(_subscriptions.Subscribe(path, eventName, callback, context, false, filters));
 }