-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Generator and AsyncGenerator #31
Comments
Hi @lxsmnsyc I see this already implemented in code but is that not flagged ready to use? Try to use it with solid start but seem like doesn't work export const logHello = async function (message: string) {
'use server'
console.log(message)
return {
title: 'Hello World',
async* [Symbol.asyncIterator](): AsyncIterator<number> {
await Promise.resolve()
yield 1
await new Promise((resolve) => setTimeout(resolve, 1000))
yield 2
await new Promise((resolve) => setTimeout(resolve, 5000))
yield 3
},
}
} export const logHello = async function * (message: string) {
"use server";
console.log(message);
yield { a: true }
await new Promise((resolve) => setTimeout(resolve, 5000))
yield { b: true }
}; |
@ducan-ne Last time I've tested this this should work. Please provide more info. |
@lxsmnsyc
Error
This is my first time tried solid start so I'm not sure it's right way to use generator, but that's how we use it js |
Okay I've tested this one, this isn't a Seroval problem. Please create an issue in SolidStart. I intend to clean up this thread since it merits its own issue thread. |
Okay, thank for your infromation |
This functionality works just fine for me in SolidStart. |
@theturtle32 are we talking about the last comment or the entire concept |
The entire concept works fine for me. |
I use server functions with async generators to return chunks of streaming chat-bot responses from the server to the client via seroval. |
And it appears that the related bug in SolidStart was closed as completed on May 20th. |
@theturtle32 yep it's been resolved. This topic is originally for the full support of Generators and AsyncGenerators (this also includes the |
No description provided.
The text was updated successfully, but these errors were encountered: