Skip to content

RSocket routing definition alike tRPCΒ #253

@linux-china

Description

@linux-china

Routing is built by RSocket by default. https://github.com/rsocket/rsocket/blob/master/Extensions/Routing.md

Is it possible to define RSocket router alike tRPC? It's really easy for client and server sides.

const helloRouter = router({
    hello: t.procedure
        .input(
            z.object({
                name: z.string(),
            }),
        )
        .request(({input}) => `hello ${input.name}` ),
    hello2: publicProcedure
        .input(z.string())
        .fire(({input}) => {
          console.log(input);
      })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions