Open
Description
Currently the api does not allow passing context instead of timeouts. My suggestion is to refactor long running methods to their *WithContext
alternative and change the existing methods to call those with background context. While this is a large request, I think it is really needed with many applications.
Example:
func (a *Adapter) Connect(address Address, params ConnectionParams) (d Device, e error) {
d, e = a.ConnectWithContext(context.Background(), address, params)
return
}
func (a *Adapter) ConnectWithContext(ctx context.Context, address Address, params ConnectionParams) (Device, error) {
// actual implementation
}
Activity