scalecube-services icon indicating copy to clipboard operation
scalecube-services copied to clipboard

Redudant methods found at ServiceCall class

Open artem-v opened this issue 7 years ago • 3 comments


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

artem-v avatar Jul 27 '18 00:07 artem-v

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.

ronenhamias avatar Jul 27 '18 07:07 ronenhamias

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.

artem-v avatar Jul 27 '18 09:07 artem-v

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 :)

ronenhamias avatar Jul 27 '18 13:07 ronenhamias