예제 #1
0
        /// <inheritdoc/>
        public IEventListener Create(Action <IEventListenerOptionsBuilder> configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }
            IEventListenerOptionsBuilder builder = new EventListenerOptionsBuilder();

            configuration(builder);
            EventListenerOptions options = builder.Build();

            return(ActivatorUtilities.CreateInstance <EventListener>(this.ServiceProvider, options));
        }
예제 #2
0
 /// <summary>
 /// Initializes a new <see cref="EventListenerOptionsBuilder"/>
 /// </summary>
 /// <param name="options">The <see cref="EventListenerOptions"/> to configure</param>
 public EventListenerOptionsBuilder(EventListenerOptions options)
 {
     this.Options = options;
 }
예제 #3
0
 /// <summary>
 /// Initializes a new <see cref="IEventListener"/>.
 /// </summary>
 /// <param name="logger">The service used to perform logging</param>
 /// <param name="kubernetes">The service used to communicate with Kubernetes.</param>
 /// <param name="options">The options used to configure the <see cref="EventListener"/></param>
 public EventListener(ILogger <EventListener> logger, IKubernetes kubernetes, EventListenerOptions options)
 {
     this.Logger     = logger;
     this.Kubernetes = kubernetes;
     this.Options    = options;
 }