Breaking Changes
#839 Add semaphore to throttle incoming searches, MaximumConcurrentSearches setting to control it
This change introduces internal throttling for searches, preventing more than 10 (by default) from being active at a time, and enqueueing subsequent searches over the limit, resuming them when the count drops below the limit. The MaximumConcurrentSearches option is used to control the number of allowable searches, and it defaults to 10.
A new SearchState enum member, Queued, is added to signal external applications that a search has been queued. Searches that will execute immediately will transition into and then quickly out of this state, while searches that must wait for an available slot will enter this state and stay there until they proceed.
This is a breaking change because of the addition to the SearchState enum. The addition of the limiting logic might be considered breaking as well.
#841 Add support for multiple directories in 'folder contents' response
Prior to 7.0.0, the GetDirectoryContentsAsync() method returned a singular Directory, and this is consistent with how every Soulseek client except Soulseek NS works; only the files located in the requested directory are returned; subdirectories are ignored.
Beginning with 7.0.0, the return type of GetDirectoryContentsAsync() is changed to IReadOnlyCollection<Directory>, and the underlying logic correctly parses the second and subsequent directories from the network response. Additionally, the DirectoryContentsResolver function expects an IEnumerable<Directory> as a return type instead of the singular Directory, allowing clients to return the contents of subdirectories if so desired.
Important to note that the inclusion of subdirectories will only work with 1) Soulseek NS, and 2) any client that uses this library and chooses to return subdirectories (slskd will add support in a future update)
Code broken by this change can be fixed by changing relevant types to support IReadOnlyCollection<Directory> and IEnumerable<Directory> where a singular Directory is used today. To retain the behavior as it was prior to this update, take only the FIRST directory from the list and discard the rest.
When returning values to DirectoryContentsResolver, ensure the files located directly in the requested directory are added to the FIRST directory in the list returned to Soulseek.NET. A quick way to make this update would be to wrap the existing return value in new List<Directory>() { <existing directory> }.
Breaking Changes
#839 Add semaphore to throttle incoming searches, MaximumConcurrentSearches setting to control it
This change introduces internal throttling for searches, preventing more than 10 (by default) from being active at a time, and enqueueing subsequent searches over the limit, resuming them when the count drops below the limit. The
MaximumConcurrentSearchesoption is used to control the number of allowable searches, and it defaults to 10.A new
SearchStateenum member,Queued, is added to signal external applications that a search has been queued. Searches that will execute immediately will transition into and then quickly out of this state, while searches that must wait for an available slot will enter this state and stay there until they proceed.This is a breaking change because of the addition to the
SearchStateenum. The addition of the limiting logic might be considered breaking as well.#841 Add support for multiple directories in 'folder contents' response
Prior to 7.0.0, the
GetDirectoryContentsAsync()method returned a singularDirectory, and this is consistent with how every Soulseek client except Soulseek NS works; only the files located in the requested directory are returned; subdirectories are ignored.Beginning with 7.0.0, the return type of
GetDirectoryContentsAsync()is changed toIReadOnlyCollection<Directory>, and the underlying logic correctly parses the second and subsequent directories from the network response. Additionally, theDirectoryContentsResolverfunction expects anIEnumerable<Directory>as a return type instead of the singularDirectory, allowing clients to return the contents of subdirectories if so desired.Important to note that the inclusion of subdirectories will only work with 1) Soulseek NS, and 2) any client that uses this library and chooses to return subdirectories (slskd will add support in a future update)
Code broken by this change can be fixed by changing relevant types to support
IReadOnlyCollection<Directory>andIEnumerable<Directory>where a singularDirectoryis used today. To retain the behavior as it was prior to this update, take only the FIRST directory from the list and discard the rest.When returning values to
DirectoryContentsResolver, ensure the files located directly in the requested directory are added to the FIRST directory in the list returned to Soulseek.NET. A quick way to make this update would be to wrap the existing return value innew List<Directory>() { <existing directory> }.