apple / swift-service-discovery

A service discovery API for Swift.
https://swiftpackageindex.com/apple/swift-service-discovery/documentation
Apache License 2.0
213 stars 21 forks source link

Define filterInstance. #19

Closed Lukasa closed 4 years ago

Lukasa commented 4 years ago

Motivation:

In apple#17 we added support for transforming instance types for a service discovery implementation. This is great, but another common requirement might be to exclude some instances altogether based on some criterion.

This corresponds directly to another combinator, filter. Let's add filterInstance to allow users to implement this easily.

Modifications:

Results:

Users can perform straightforward filtering of instances.

swift-server-bot commented 4 years ago

Can one of the admins verify this patch?