Skip to content

Conversation

@Marenz
Copy link
Contributor

@Marenz Marenz commented Oct 30, 2024

No description provided.

Signed-off-by: Mathias L. Baumann <[email protected]>
@Marenz Marenz requested review from a team as code owners October 30, 2024 14:32
@github-actions github-actions bot added part:docs Affects the documentation part:dispatcher labels Oct 30, 2024
@Marenz Marenz added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Oct 30, 2024
@Marenz Marenz enabled auto-merge October 30, 2024 14:36
Copy link

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only a suggestion to check for. LGTM otherwise

README.md Outdated
```python
from frequenz.client.dispatch import Client

# Initialize the client

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to wrap all the code within an async function. I know this will make the example much more verbose but otherwise the user might try to instantiate the client outside the asynchronous event loop.

For instance:

import asyncio
from frequenz.client.dispatch import Client

async def list_dispatches() -> None:
    # Initialize the client
    client = Client(key="your_api_key", server_url="grpc://fz-0004.frequenz.io")

    # List all dispatches for a specific microgrid
    async for page in client.list(microgrid_id=1):
        for dispatch in page:
            print(dispatch)

asyncio.run(list_dispatches())

Signed-off-by: Mathias L. Baumann <[email protected]>
@Marenz Marenz added this pull request to the merge queue Oct 31, 2024
Merged via the queue into frequenz-floss:v0.x.x with commit 64f2633 Oct 31, 2024
14 checks passed
@Marenz Marenz deleted the readthem branch October 31, 2024 09:43
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part of this is automatically generated by the repo config template, it would be good to update the template to put everything that is common to all repos there, to avoid every project diverging into completely different README structure and information.

@llucax
Copy link
Contributor

llucax commented Nov 5, 2024

@Marenz ☝️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:dispatcher part:docs Affects the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants