-
Notifications
You must be signed in to change notification settings - Fork 51
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
Simplify entry file heuristics #9
Conversation
// SPDX-License-Identifier: Apache-2.0 | ||
import type { JobContext } from './job_context.js'; | ||
|
||
type entryFunction = (job: JobContext) => Promise<void>; |
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.
should it return Promise<void | () => void>
to reflect that it could return a function?
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.
does it return anything? all of the examples on Python's agents return void, and regardless we don't do anything with the potential return value of this function, we just run it.
there's no reason to return anything because there's nowhere to return it to
if we really want to allow returning things for whatever reason we should replace void with unknown
to prevent type errors
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.
the confusion is my fault, I thought it'd be nice to provide some sort of resource cleanup functionality, but I thought about it just in terms of API and not in terms of what's already implemented... I guess that we should just remove the comment that mentions the return cleanup function and leave the return type as Promise<void>
.
still feels unidiomatic and handwavey magic, but it's better. Suggested-by: lukasIO <[email protected]>
also added ChunkedStreams which were recently implemented in Python agents and made some more changes to the end-user API |
still feels unidiomatic and handwavey magic, but it's better.
Suggested-by: lukasIO [email protected]