public async Task AllocateFunctionAsync(MastodonAuthentication auth) { this.Auth = auth; this.Counter = this.GetFunctionCounter(auth); this._function = await this.Counter.IncrementAsync(); this.OnFunctionAllocated(); this._function.Updated += this.OnFunctionUpdated; this._function.Deleted += this.OnFunctionDeleted; }
/// <summary> /// 認証オブジェクトから、サーバと通信を行うためのConnectionFunctionを取り出す /// </summary> /// <param name="auth">認証オブジェクト</param> /// <returns></returns> protected abstract ConnectionFunctionCounterBase <T> GetFunctionCounter(MastodonAuthentication auth);
protected override ConnectionFunctionCounterBase <MastodonNotification> GetFunctionCounter(MastodonAuthentication auth) => auth.NotificationStreamingFunctionCounter;
protected override ConnectionFunctionCounterBase <MastodonStatus> GetFunctionCounter(MastodonAuthentication auth) => auth.HomeStreamingFunctionCounter;