Socket
Socket
Sign inDemoInstall

@anchan828/nest-cloud-run-queue-tasks-publisher

Package Overview
Dependencies
104
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @anchan828/nest-cloud-run-queue-tasks-publisher

> TODO: description


Version published
Weekly downloads
374
decreased by-58.26%
Maintainers
1
Install size
30.4 MB
Created
Weekly downloads
 

Readme

Source

@anchan828/nest-cloud-run-queue-tasks-publisher

Install

npm i @anchan828/nest-cloud-run-queue-tasks-publisher

Usage

NOTE: You may want to do tutorial for using Tasks with Cloud Run before using them. https://cloud.google.com/run/docs/triggering/using-tasks

Import publisher module

@Module({
  imports: [
    TasksPublisherModule.register({
      clientConfig: {
        // If necessary
        projectId: "projectId",
        keyFilename: "path/to/file.json",
      },
      publishConfig: {
        httpRequest: {
          // By setting this as the default URL here, you can save yourself the trouble of setting the URL each time.
          url: "https://example-this-is-demo-uc.a.run.app",
        },
      },
      queue: "projects/test/locations/location/queues/nest-cloud-run-queue-demo",
    }),
  ],
})
export class PublisherAppModule {}

Publish message to queue

export class Service {
  constructor(private readonly tasksService: TasksPublisherService) {}

  public async sendMessage(): Promise<void> {
    await this.tasksService.publish({
      // Required. this property is used by @anchan828/nest-cloud-run-queue-worker
      name: "Worker name",
      // string or object. ex, { text: "text" }
      data: "text",
    });
  }
}

See more information: https://github.com/anchan828/nest-cloud-run-queue#readme

FAQs

Last updated on 05 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc