Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
habdelra committed Mar 15, 2024
1 parent c3bffaa commit cb04012
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions packages/host/app/lib/browser-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class BrowserQueue implements Queue {
get isDestroyed() {
return this.#isDestroyed;
}

get hasStarted() {
return this.#hasStarted;
}
Expand Down Expand Up @@ -76,7 +77,7 @@ export class BrowserQueue implements Queue {
}, 250);

private async drainJobs() {
await this.#flush;
await this.flush();

let jobsDrained: () => void;
this.#flush = new Promise((res) => (jobsDrained = res));
Expand Down Expand Up @@ -106,6 +107,6 @@ export class BrowserQueue implements Queue {

async destroy() {
this.#isDestroyed = true;
await this.#flush;
await this.flush();
}
}
2 changes: 1 addition & 1 deletion packages/host/tests/unit/queue-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ module('Unit | queue | browser implementation', function (hooks) {
});

test(`a job can throw an exception`, async function (assert) {
queue.register('increment', async (a: number) => a + 1);
queue.register('boom', async () => {
throw new Error('boom!');
});
let [errorJob, nonErrorJob] = await Promise.all([
queue.publish<number>('boom', null),
queue.publish<number>('increment', 17),
]);
queue.register('increment', async (a: number) => a + 1);

// assert that the error that was thrown does not prevent subsequent jobs
// from running
Expand Down
1 change: 0 additions & 1 deletion packages/runtime-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"recast": "^0.23.4",
"super-fast-md5": "^1.0.1",
"transform-modules-amd-plugin": "workspace:*",
"typescript-memoize": "^1.1.1",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
2 changes: 0 additions & 2 deletions packages/runtime-common/queue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PgPrimitive } from './expression';
import { Memoize } from 'typescript-memoize';
import { Deferred } from './deferred';

export interface QueueOpts {
Expand Down Expand Up @@ -31,7 +30,6 @@ export class Job<T> {
public uuid: string,
private notifier: Deferred<T>,
) {}
@Memoize()
get done(): Promise<T> {
return this.notifier.promise;
}
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb04012

Please sign in to comment.