Skip to content

Refactor Start method in ws/client.go to avoid infinite blocking #190

@cgang

Description

@cgang

Description:

The Start method in ws/client.go contains a select {} statement at line 125, which causes the function to block forever. This behavior is misleading, since a method named Start is usually expected to launch background goroutines and return immediately, allowing callers to continue execution. Infinite blocking should not occur inside the method—shutdown logic should be managed externally.

Suggested Improvement:

Refactor Start so it does not block forever.
Remove or replace select {} with proper goroutine management.
Let Start return immediately after launching necessary goroutines.
Move blocking/wait/shutdown to the calling code if needed.

Reference:

Code location

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions