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; }
internal void ExecuteInitial(Subscription sub) { lock (_lock) { if (!_initialReceive) { _initialSubscriptions.Enqueue(sub); return; } } sub.Process(this); }