Hello I was looking at new GenericHost sample and it seems now Host and SiloBuilder share same ServiceProvider as (if I am not mistaken) SiloBuilder actually populates Host's service collection. But that is still not true with ClientBuilder. Are there any plans on making ClientBuilder sit on top of generic host as well? I realize there is no need for injection usually in ClientBuilder, but still it has ConfigureServices method and thus the question.
... it seems now Host and SiloBuilder share same ServiceProvider as (if I am not mistaken)...
Yes, you are correct.
Are there any plans on making
ClientBuildersit on top of generic host as well?
No plans yet - but I don't see why not. There would be an issue adding both a client and a silo to the same HostBuilder (some services would clash). Since 2.3.0 users do not need to add both a silo and client to a single HostBuilder since silos provide IClusterClient + IGrainFactory to the HostBuilder's container for others to access it.
You could build the client outside of the host builder and add it in ConfigureServices.
That sample needs some refactoring - the reactive caching one shows how to use the hosted service pattern to make it cleaner. One can then create an extension method to achieve the same as .UseOrleans() on the silo host project.
However, as @ReubenBond stated, from 2.3.0 one does not even need a separate client anymore. For example the orleans blazor sample (not yet PR'ed), does not use a client at all and exposes a Web API right from the silo process.
@JorgeCandeias You can go see this https://github.com/lfzm/Orleans.MultiClient
@lfzm Very nice. Will you be pushing it to contrib?
@JorgeCandeias Yes, the HttpContext Inject RequestContext tool will be added recently to make it easy for Orleans to get HttpContext data.
Thanks, looks like I have all I need now 馃憤
Most helpful comment
@JorgeCandeias You can go see this https://github.com/lfzm/Orleans.MultiClient