From 5660e0f4f0c8d481b87db6b2712c1a52f18e3f80 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 22 Sep 2020 13:49:01 +0200 Subject: [PATCH] rename send scheduler to request scheduler --- src/matrix/Session.js | 12 ++++++------ .../{SendScheduler.js => net/RequestScheduler.js} | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) rename src/matrix/{SendScheduler.js => net/RequestScheduler.js} (93%) diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 32fe96b5..fdc9a83f 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -16,7 +16,7 @@ limitations under the License. import {Room} from "./room/Room.js"; import { ObservableMap } from "../observable/index.js"; -import {SendScheduler} from "./SendScheduler.js"; +import {RequestScheduler} from "./net/RequestScheduler.js"; import {User} from "./User.js"; import {DeviceMessageHandler} from "./DeviceMessageHandler.js"; import {Account as E2EEAccount} from "./e2ee/Account.js"; @@ -45,8 +45,8 @@ export class Session { constructor({clock, storage, unwrappedHsApi, sessionInfo, olm, olmWorker, cryptoDriver, mediaRepository}) { this._clock = clock; this._storage = storage; - this._sendScheduler = new SendScheduler({hsApi: unwrappedHsApi, clock}); - this._hsApi = this._sendScheduler.createHomeServerApiWrapper(); + this._requestScheduler = new RequestScheduler({hsApi: unwrappedHsApi, clock}); + this._hsApi = this._requestScheduler.createHomeServerApiWrapper(); this._mediaRepository = mediaRepository; this._syncInfo = null; this._sessionInfo = sessionInfo; @@ -268,12 +268,12 @@ export class Session { } get isStarted() { - return this._sendScheduler.isStarted; + return this._requestScheduler.isStarted; } dispose() { this._olmWorker?.dispose(); - this._sendScheduler.stop(); + this._requestScheduler.stop(); this._sessionBackup?.dispose(); for (const room of this._rooms.values()) { room.dispose(); @@ -297,7 +297,7 @@ export class Session { const operations = await opsTxn.operations.getAll(); const operationsByScope = groupBy(operations, o => o.scope); - this._sendScheduler.start(); + this._requestScheduler.start(); for (const [, room] of this._rooms) { let roomOperationsByType; const roomOperations = operationsByScope.get(room.id); diff --git a/src/matrix/SendScheduler.js b/src/matrix/net/RequestScheduler.js similarity index 93% rename from src/matrix/SendScheduler.js rename to src/matrix/net/RequestScheduler.js index 4080e8ad..0e75c9d7 100644 --- a/src/matrix/SendScheduler.js +++ b/src/matrix/net/RequestScheduler.js @@ -14,10 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {AbortError} from "../utils/error.js"; -import {HomeServerError} from "./error.js"; -import {HomeServerApi} from "./net/HomeServerApi.js"; -import {ExponentialRetryDelay} from "./net/ExponentialRetryDelay.js"; +import {AbortError} from "../../utils/error.js"; +import {HomeServerError} from "../error.js"; +import {HomeServerApi} from "./HomeServerApi.js"; +import {ExponentialRetryDelay} from "./ExponentialRetryDelay.js"; class Request { constructor(methodName, args) { @@ -58,7 +58,7 @@ for (const methodName of Object.getOwnPropertyNames(HomeServerApi.prototype)) { } } -export class SendScheduler { +export class RequestScheduler { constructor({hsApi, clock}) { this._hsApi = hsApi; this._clock = clock;