You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if it's possible to make a Select method that reduce the boilerplate code and handles all the boring stuff automatically (for example the very annoting max+1 bit).
A proposal for a possible API, to simplify the above use case, may be the following:
// NewSet creates an array that holds all the file descriptors// and automatically converts them from int to uintptr if neededfds:=goselect.NewSet(port.handle, port.closeSignal.ReadFD())
// The same set can be used for read, write and error// (max+1) is determined internallyres, err:=goselect.Select(fds, nil, fds)
iferr!=nil {
returnerr
}
// The result contains all the three result sets (read, write, errors) and each one// can be queriedifres.IsReadable(port.handle) {
...dosomething...
}
Is this a proposal that can be considered?
Thanks!
The text was updated successfully, but these errors were encountered:
I'm using this library in my serial library project here an extract:
I'm wondering if it's possible to make a
Select
method that reduce the boilerplate code and handles all the boring stuff automatically (for example the very annotingmax+1
bit).A proposal for a possible API, to simplify the above use case, may be the following:
Is this a proposal that can be considered?
Thanks!
The text was updated successfully, but these errors were encountered: