Soulseek.NET
Soulseek.NET copied to clipboard
responseReceived in SearchOptions and in the signature of SearchAsync() are confusing
I confused myself with this briefly. The responseReceived in SearchOptions is an alternative to an event; there's a few of those throughout the library and I think they are beneficial and appropriately named.
The responseReceived argument of SearchAsync() is beneficial for sure, but I think the name could be improved to disambiguate the functionality from the options version.
A better name might be handleResponse, or maybe responseHandler, which would be more in line with how some of these other delegates are named.
There's basically three flavors within options:
resolvers: these areFuncs that take arguments and return somethingnounPastTenseVerb: these are analogs for events.stateChanged, etc. they are fire and forget- things named to reflect their purpose. very similar (perhaps the same as)
resolvers, these are inTransferOptions;governor,slotAwaiter,reporter
Within the public API of the library, there are a couple of Funcs:
outputStreamFactory: allows 'late binding' of I/O streamsinputStreamFactory: same as above
And then there's responseReceived.
All this being said (talking to myself here because it is going to be a while before I think about this again), responseHandler is the more semantically correct name.
This is a breaking change, and I'm definitely not going to rev the major version just for this; it will have to wait for the next update.