Skip to content
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

Implementation of the Ping/Pong #30

Merged
merged 6 commits into from
Nov 30, 2022
Merged

Implementation of the Ping/Pong #30

merged 6 commits into from
Nov 30, 2022

Conversation

olegbespalov
Copy link
Contributor

What?

Porting ping/pong from the k6

Why?

Resolves: #6

Ported from the k6/ws
@olegbespalov olegbespalov self-assigned this Nov 30, 2022
websockets/listeners.go Outdated Show resolved Hide resolved
websockets/websockets.go Outdated Show resolved Hide resolved
websockets/websockets.go Outdated Show resolved Hide resolved
websockets/websockets.go Show resolved Hide resolved

data := []byte(pingID)

err := w.conn.WriteControl(websocket.PingMessage, data, deadline)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the previous( k6/ws) implementation all the methods did what they did (send/ping ) on the event loop more or less. This is not the case here send does not actually send the message anymore it queues it to be send. Given that ping also writes I feel like it should be off the main loop the same way the send is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to address in e1b5a46

websockets/websockets.go Outdated Show resolved Hide resolved
websockets/websockets.go Show resolved Hide resolved
olegbespalov and others added 2 commits November 30, 2022 16:01
Co-authored-by: Mihail Stoykov <312246+mstoykov@users.noreply.github.com>
@olegbespalov olegbespalov merged commit a35089c into main Nov 30, 2022
@olegbespalov olegbespalov deleted the feat/ping-pong branch November 30, 2022 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for ping/pong
2 participants