Skip to content

Commit e44a897

Browse files
committed
🚿 Remove abort signal from start
1 parent 8c1aecc commit e44a897

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

session.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ export class Session {
104104
* If the session is already running, this method throws an error.
105105
*
106106
* The session is started in the following steps:
107-
* @param {object} options The options for the session.
108107
* @throws {Error} If the session is already running.
109108
*/
110-
start(options: { signal?: AbortSignal } = {}): void {
109+
start(): void {
111110
if (this.#running) {
112111
throw new Error("Session is already running");
113112
}
@@ -116,16 +115,6 @@ export class Session {
116115
const consumerController = new AbortController();
117116
const producerController = new AbortController();
118117

119-
const abort = (reason: unknown) => {
120-
if (this.#running) {
121-
const { consumerController, producerController } = this.#running;
122-
consumerController.abort(reason);
123-
producerController.abort(reason);
124-
}
125-
};
126-
const { signal } = options;
127-
signal?.addEventListener("abort", abort);
128-
129118
const ignoreShutdownError = (err: unknown) => {
130119
if (err === shutdown) {
131120
return;
@@ -154,7 +143,6 @@ export class Session {
154143

155144
const waiter = Promise.all([consumer, producer])
156145
.then(() => {}).finally(() => {
157-
signal?.removeEventListener("abort", abort);
158146
innerWriter.releaseLock();
159147
this.#running = undefined;
160148
});

0 commit comments

Comments
 (0)