frankie567 / httpx-ws

WebSocket support for HTTPX
https://frankie567.github.io/httpx-ws/
MIT License
110 stars 17 forks source link

#2 Add ping method #8

Closed kousikmitra closed 1 year ago

kousikmitra commented 1 year ago

fixed lint issue

codecov[bot] commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (b48b070) compared to base (644700b). Patch coverage: 100.00% of modified lines in pull request are covered.

:exclamation: Current head b48b070 differs from pull request most recent head ebaa5b8. Consider uploading reports for the commit ebaa5b8 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #8 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 2 2 Lines 261 267 +6 ========================================= + Hits 261 267 +6 ``` | [Impacted Files](https://codecov.io/gh/frankie567/httpx-ws/pull/8?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fran%C3%A7ois+Voron) | Coverage Ξ” | | |---|---|---| | [httpx\_ws/\_api.py](https://codecov.io/gh/frankie567/httpx-ws/pull/8/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fran%C3%A7ois+Voron#diff-aHR0cHhfd3MvX2FwaS5weQ==) | `100.00% <100.00%> (ΓΈ)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fran%C3%A7ois+Voron). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Fran%C3%A7ois+Voron)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

frankie567 commented 1 year ago

Looks good, @kousikmitra, thanks πŸ™ May I ask you to add payload as an optional parameter and forward it to the event initializer? Something like:

def ping(self, payload: typing.Optional[bytes] = None) -> None:
        event = wsproto.events.Ping(payload)
        self._send_event(event)
kousikmitra commented 1 year ago

Looks good, @kousikmitra, thanks πŸ™ May I ask you to add payload as an optional parameter and forward it to the event initializer? Something like:

def ping(self, payload: typing.Optional[bytes] = None) -> None:
        event = wsproto.events.Ping(payload)
        self._send_event(event)

done, changed the func signature to ping(self, payload: bytes = b"") as Ping doesn't take None

frankie567 commented 1 year ago

done, changed the func signature to ping(self, payload: bytes = b"") as Ping doesn't take None

Indeed, perfectly right! LGTM!

@all-contributors add @frankie567 for maintenance, @kousikmitra for code

allcontributors[bot] commented 1 year ago

@frankie567

I've put up a pull request to add @frankie567! :tada:

frankie567 commented 1 year ago

Yes, but now, @all-contributors add @kousikmitra for code

allcontributors[bot] commented 1 year ago

@frankie567

I've put up a pull request to add @kousikmitra! :tada: