Orleans.Http icon indicating copy to clipboard operation
Orleans.Http copied to clipboard

IApplicationPartManager dependency in endporints.MapGrains()?

Open vrecluse opened this issue 5 years ago • 2 comments

Hi, I'm planing to split the Http gateway code from orleans silo. Which the gateway server is not a silo, and should only depends on grains interfaces, orleans client, and routes http requests to the background silos. But when I start gateway, it complains IApplicationPartManager not found. Is there any workaround?

vrecluse avatar Jun 16 '20 08:06 vrecluse

Maybe this could work if the IApplicationPartManager was taken from the client's container instead of the silos?

ReubenBond avatar Jun 24 '20 16:06 ReubenBond

It seems no simple way to do that... I use following code as a workaround, a bit intriguing...

            // Application parts
            var parts = new ApplicationPartManager();
            services.AddSingleton<IApplicationPartManager>(parts);
            parts.AddApplicationPart(new AssemblyPart(typeof( IMyGrain ).Assembly));
            parts.AddFeatureProvider(new AssemblyAttributeFeatureProvider<GrainInterfaceFeature>());

vrecluse avatar Aug 14 '20 02:08 vrecluse