Skip to content

Commit

Permalink
feat: read task queue name from env
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydn committed May 3, 2024
1 parent 06312e6 commit 0edee6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createId } from '@paralleldrive/cuid2'
import { Client, Connection } from '@temporalio/client'

import type * as Workflows from './types/workflow-commands'
import { openAccount as openAccountWorkflow } from './workflows'

async function run() {
const connection = await Connection.connect()
const client = new Client({
Expand Down Expand Up @@ -30,7 +32,7 @@ async function run() {

// Here is how we start our workflow
const handle = await client.workflow.start(openAccountWorkflow, {
taskQueue: 'saga-demo',
taskQueue: process.env.TEMPORAL_TASK_QUEUE || 'saga-pattern-demo',
workflowId: 'saga-' + openAccount.accountId,
args: [openAccount],
})
Expand Down
1 change: 1 addition & 0 deletions src/clients/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { log } from '@temporalio/activity'

import type * as Accounts from '../types/accounts-client'
import type * as Banking from '../types/banking-client'
import type * as Clients from '../types/clients-client'
Expand Down
1 change: 1 addition & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Worker, type WorkerOptions } from '@temporalio/worker'

import { createActivities } from './activities'
import { createClients } from './clients'

Expand Down
1 change: 1 addition & 0 deletions src/workflows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActivityFailure, ApplicationFailure, log, proxyActivities } from '@temporalio/workflow'

import type { createActivities } from './activities'
import * as Workflows from './types/workflow-commands'

Expand Down

0 comments on commit 0edee6a

Please sign in to comment.