#Stream using ReadableStream (SSE - Server Sent Events)

6 messages · Page 1 of 1 (latest)

stuck ruin
#

How can I stream results out of my runpod serverless worker?

Some background:
I am **NOT **using VLLM
I **am **using yield in my handler
Hitting the v2/{endpoint_id}/stream/{job_id} endpoint gives me back a JSON containing the partial response chunks and "consumes" the "queue". Am I expected to poll the /stream endpoint? Because if so I'm going to poll it every 50ms since it doesn't appear to be rate limited.

What I was expecting was a ReadableStream... did I misconfigure something? Should I mark my generator handler as async? Does setting return_aggregate_stream: True return a ReadableStream under /run?

daring wyvern
#

No check general 👌

stuck ruin
#

Answering my own question for posterity:

No, this is not supported, you have to poll the /stream endpoint, but this is not so bad, because it is blocking, meaning it will wait until a chunk arrives and reply immediately

lost mantleBOT
daring wyvern
#

Yay

#

I'll try to write a piece of feedback about this