scalecube-services
scalecube-services copied to clipboard
Redudant methods found at ServiceCall class
Mono<Void> oneWay(ServiceMessage request, Address address)
Mono<ServiceMessage> requestOne(ServiceMessage request, Class<?> responseType, Address address)
Flux<ServiceMessage> requestMany(ServiceMessage request, Class<?> responseType, Address address)
Looks like those methods were added for sending on concrete address, bypassing phase router.route()
Why we can't just set a custom router (it's just a biFunction) at serviceCall. In this case public api would remain clear (w/o those overloaded variants) and client would have to have to use setup mechanism in order to do something custom.
Looping @ronenhamias
there are rare cases where you want to control manually the addressing to specific endpoint for example if you are developing some distributed algo such as leader election.
control manually the addressing
totally + 1 for this
there are rare cases
That's the point: it's rare. Hence let's not pollute public api with overloaded signatures. In such cases let's client go and define a custom router on service call.
router does not answer the case as with router you delegate it to router to make decesion in this case we already know what is the target.
anyhow its not written in stone so if you think there is much better alternative please do suggest :)