-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for defining streams #4513
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
Azure/typespec-azure#1615 addresses the e2e test failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just need to update the init templates to include @stream
and maybe bring this up tomorrow in scrum to make sure we want to add this new dependency on http
@@ -0,0 +1,42 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this docs/libraries/stream/reference
duplicate with docs/libraries/streams/reference
?
Seems like the playground is not working here link I wonder if we should add those libraries into the playground? Also, the openapi3 output from my local is generating the response type as string, get:
operationId: subscribe
parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/jsonl:
schema:
type: string is this expected? If yes, how can we link the output type to the model |
* } | ||
* | ||
* @TypeSpec.Events.events | ||
* union ChannelEvents { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just curious if we should suggest TypeSpec author to use discriminated union if there's multiple event types? I think client side probably need to handle them differently?
* usermessage: UserMessage, | ||
* userdisconnect: UserDisconnect, | ||
* | ||
* @Events.contentType("text/plain") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess different event could have different content type? I wonder how can we get the context type for a specific event type?
* Message, | ||
* } | ||
* | ||
* op subscribe(): JsonlStream<Events>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a little confused by the jsonlstream usage and the event usage, does jsonl stream necessarily mean it's an event based?
Related: #154