Skip to content

Commit

Permalink
docs: fix RequestContext serialization link and wording
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryrahul committed Feb 14, 2025
1 parent c4e700b commit 2152baa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/docs/guides/developer-guide/worker-job-queue/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,9 @@ export class ProductVideoPlugin {}

Sometimes you need to pass the [RequestContext object](/reference/typescript-api/request/request-context) to the `process` function of a job, since `ctx` is required by many Vendure
service methods that you may be using inside your `process` function. However, the `RequestContext` object itself is not serializable,
so it cannot be passed directly to the `JobQueue.add()` method. Instead, you can serialize the `RequestContext` using the ctx.serialize() method `
method](/reference/typescript-api/request/request-context/#serialize), and then deserialize it in the `process` function using the static `deserialize` method:
so it cannot be passed directly to the `JobQueue.add()` method. Instead, you can serialize the `RequestContext` using the [`ctx.serialize()` method](/reference/typescript-api/request/request-context/#serialize),
and then deserialize it in the `process` function using the static `deserialize` method.


```ts
import { Injectable, OnModuleInit } from '@nestjs/common';
Expand Down

0 comments on commit 2152baa

Please sign in to comment.