-
Notifications
You must be signed in to change notification settings - Fork 6
Danny/kernel 297 docs mention timeouts for async invocation #43
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
Changes from 2 commits
18253ec
6713198
ece1159
d8e57b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,10 @@ const client = new Kernel({ | |
| apiKey: 'My API Key', | ||
| }); | ||
|
|
||
| const deployments = await client.deployments.list(); | ||
|
|
||
| console.log(deployments); | ||
| // Automatically fetches more pages as needed. | ||
| for await (const deploymentListResponse of client.deployments.list()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the issue with making changes to this and is if we regenerate this, it'll be overwritten. I think this auto-generated snippet list may be overkill and we may just revert back to manually written code snippets. It seems difficult to use and we have more custom code we write on our docs than the snippets we use... |
||
| console.log(deploymentListResponse.id); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accessing |
||
| } | ||
| ``` | ||
|
|
||
|
|
||
|
|
@@ -18,7 +19,8 @@ from kernel import Kernel | |
| client = Kernel( | ||
| api_key="My API Key", | ||
| ) | ||
| deployments = client.deployments.list() | ||
| print(deployments) | ||
| page = client.deployments.list() | ||
| page = page.items[0] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Python example has a logic error. Line 22 assigns the result of |
||
| print(page.id) | ||
| ``` | ||
| </CodeGroup> | ||
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 code change appears inconsistent with other list API examples in this project. The
for await...ofloop assumes the client returns an async iterator, but other examples (like get-browsers.mdx, get-apps.mdx, get-profiles.mdx) use a simpleawait client.resource.list()pattern. This change breaks the consistency unless the deployments API specifically behaves differently from other list endpoints. Please verify this API behavior and ensure consistency across all list examples.