Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

allow creation of cron/queue for non NextJS api folders (e.g. for tRPC) #7

@boringContributor

Description

@boringContributor

Currently, the SDK only allows the creation of a Queue/Cron by importing the specific NextJS API handler.

Libraries like tRPC have other approaches and we want to align with them.

Possible solution:

import { Queue } from '@serverlessq/core'

const queue = new Queue(...)

const appRouter = trpc
  .router()
  .mutation('createPost', {
    input: z.object({ name: z.string().min(5) }),
    async resolve(req) {
     ...
     queue.enqueue(...)
     ...
    },
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions