lyft / gostats

Go client for Stats
Other
56 stars 18 forks source link

add StartContext, remove Stop #147

Closed tomwans closed 1 year ago

tomwans commented 1 year ago

This change removes the Stop() method from the previous change, and fixes the Start behavior to be backwards compatible.

The previous change changed the behavior of Start() to be non-blocking from blocking. This is a change in API that we should revert. Stop is also removed - even though this too is a breaking change this is not a 1.0 release and the release is short-lived as of right now.

This change introduces a new method, StartContext, which should achieve the goals from the last change, but retain backwards compatibility.

StartContext is a blocking call like Start is, but allows for a context to be passed in, thus allowing for cancellation.