private static Constructor Create(Type publicationType) { if (!publicationType.IsGenericTypeDefinition) { throw Errors.PublicationTypeMustBeOpenGenericType(nameof(publicationType)); } var handler = new FactoryApplyHandler(publicationType); IPublication Factory(IPublisher publisher, IComputed computed, Symbol publicationId, IMomentClock clock) => computed.Apply(handler, (publisher, publicationId, clock)); return(Factory); }
private static Constructor Create(Type genericType) { if (!genericType.IsGenericTypeDefinition) { throw Errors.TypeMustBeOpenGenericType(genericType); } var handler = new FactoryApplyHandler(genericType); SubscriptionProcessor Factory( IPublication publication, Channel <Message> outgoingMessages, TimeSpan subscribeTimeout, IMomentClock clock, ILoggerFactory loggerFactory) => publication.Apply(handler, (outgoingMessages, subscribeTimeout, clock, loggerFactory)); return(Factory); }