Mohammed
Mohammed4mo ago

Using duplex stream as transport?

I'm using a framework that gives me a node duplex stream for communication between front and back end. Can I somehow wrap that stream with tRPC?
9 Replies
Alex / KATT 🐱
i don't think any browser supports duplex streams?
Mohammed
MohammedOP4mo ago
It runs inside an electron app
Alex / KATT 🐱
we don't have any link that supports duplex transport except the wsLink that kinda does what's your usecase? we might be be open to adding it [if you do all the work, we have no use of it ourselves]
Mohammed
MohammedOP4mo ago
Use case is communication between a worker process and desktop/mobile front ends (https://docs.pears.com/pear-runtime/api#const-pipe-pear.worker.pipe)
Mohammed
MohammedOP4mo ago
I'm not sure if I'm up to the task. That means writing some sort of plugin for trpc?
Alex / KATT 🐱
why do you want the streams to be duplex?
Mohammed
MohammedOP4mo ago
It's not that I want that. That's what the framework gives me
Alex / KATT 🐱
i don't understand the problem, but you can definitely use trpc in electron (just google "trpc electron")
Mohammed
MohammedOP4mo ago
Aight, thanks for your help