Skip to content

Commit

Permalink
feat: direct access to pgboss added
Browse files Browse the repository at this point in the history
  • Loading branch information
samaratungajs committed Sep 8, 2024
1 parent 9c9768a commit 0c9badf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export class JobSchedulerService {

```

#### Access `boss` Directly

You can access the `PgBoss` instance directly via `pgBossService.boss`

#### Handle jobs using the `@Job` decorator

```ts
Expand Down
5 changes: 4 additions & 1 deletion lib/pgboss.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { PGBOSS_TOKEN } from "./utils/consts";

@Injectable()
export class PgBossService {
constructor(@Inject(PGBOSS_TOKEN) private readonly boss: PgBoss) {}
public boss: PgBoss;
constructor(@Inject(PGBOSS_TOKEN) boss: PgBoss) {
this.boss = boss;
}

async scheduleJob<TData extends object>(
name: string,
Expand Down

0 comments on commit 0c9badf

Please sign in to comment.