internal EventUserBuilder(User user, IEventProcessorConfiguration config) { _user = user; _config = config; _result = new EventUser(); _privateAttrs = null; }
public void Apply(IEventProcessorConfiguration configuration) { Guard.AgainstNull(configuration, "configuration"); if (EventProcessorConfiguration.Section == null || EventProcessorConfiguration.Section.Modules == null) { return; } var types = new List<Type>(); foreach (ModuleElement moduleElement in EventProcessorConfiguration.Section.Modules) { var type = Type.GetType(moduleElement.Type); Guard.Against<ConfigurationErrorsException>(type == null, string.Format(RecallResources.UnknownTypeException, moduleElement.Type)); types.Add(type); } foreach (var type in types) { try { type.AssertDefaultConstructor(string.Format(RecallResources.DefaultConstructorRequired, "Module", type.FullName)); configuration.Modules.Add((IModule)Activator.CreateInstance(type)); } catch (Exception ex) { throw new ConfigurationErrorsException(string.Format(RecallResources.ModuleInstantiationException, ex.Message)); } } }
public EventProcessor(IEventProcessorConfiguration configuration) { Guard.AgainstNull(configuration, "configuration"); Configuration = configuration; Events = new EventProcessorEvents(); }
internal DefaultEventProcessor(IEventProcessorConfiguration config, IUserDeduplicator userDeduplicator, HttpClient httpClient, string eventsUriPath) { _stopped = new AtomicBoolean(false); _inputCapacityExceeded = new AtomicBoolean(false); _messageQueue = new BlockingCollection <IEventMessage>(config.EventCapacity); _dispatcher = new EventDispatcher(config, _messageQueue, userDeduplicator, httpClient, eventsUriPath); _flushTimer = new Timer(DoBackgroundFlush, null, config.EventFlushInterval, config.EventFlushInterval); if (userDeduplicator != null && userDeduplicator.FlushInterval.HasValue) { _flushUsersTimer = new Timer(DoUserKeysFlush, null, userDeduplicator.FlushInterval.Value, userDeduplicator.FlushInterval.Value); } else { _flushUsersTimer = null; } }
internal EventDispatcher(IEventProcessorConfiguration config, BlockingCollection <IEventMessage> messageQueue, IUserDeduplicator userDeduplicator, HttpClient httpClient, string eventsUriPath) { _config = config; _userDeduplicator = userDeduplicator; _flushWorkersCounter = new CountdownEvent(1); _httpClient = httpClient; _uri = new Uri(_config.EventsUri, eventsUriPath); _random = new Random(); _httpClient.DefaultRequestHeaders.Add("X-LaunchDarkly-Event-Schema", DefaultEventProcessor.CurrentSchemaVersion); EventBuffer buffer = new EventBuffer(config.EventCapacity); Task.Run(() => RunMainLoop(messageQueue, buffer)); }
internal EventOutputFormatterScope(IEventProcessorConfiguration config, TextWriter tw, bool inlineUsers) { _config = config; _jsonWriter = new JsonTextWriter(tw); _jsonSerializer = new JsonSerializer(); }
internal EventOutputFormatter(IEventProcessorConfiguration config) { _config = config; }
internal static EventUser FromUser(User user, IEventProcessorConfiguration config) { EventUserBuilder eub = new EventUserBuilder(user, config); return(eub.Build()); }