| 30 | const client = new cloudTasks.CloudTasksClient(); |
| 31 | |
| 32 | async function createQueue() { |
| 33 | // Send create queue request. |
| 34 | const [response] = await client.createQueue({ |
| 35 | // The fully qualified path to the location where the queue is created |
| 36 | parent: client.locationPath(project, location), |
| 37 | queue: { |
| 38 | // The fully qualified path to the queue |
| 39 | name: client.queuePath(project, location, queue), |
| 40 | appEngineHttpQueue: { |
| 41 | appEngineRoutingOverride: { |
| 42 | // The App Engine service that will receive the tasks. |
| 43 | service: 'default', |
| 44 | }, |
| 45 | }, |
| 46 | }, |
| 47 | }); |
| 48 | console.log(`Created queue ${response.name}`); |
| 49 | } |
| 50 | createQueue(); |
| 51 | // [END cloud_tasks_create_queue] |
| 52 | } |