/// <summary> /// Initializes a new instance of the <see cref="EntityProcessor{T}"/> class /// </summary> /// <param name="dispatcher">A <see cref="IEntityDispatcher{ISportEvent}" /> whose dispatched entities will be processed by the current instance</param> /// <param name="writer">A <see cref="SportEntityWriter" /> used to output / log the dispatched entities</param> /// <param name="marketWriter">A <see cref="MarketWriter"/> used to write market and outcome data</param> public EntityProcessor(IEntityDispatcher <T> dispatcher, SportEntityWriter writer = null, MarketWriter marketWriter = null) { Guard.Argument(dispatcher, nameof(dispatcher)).NotNull(); _dispatcher = dispatcher; _sportEntityWriter = writer; _marketWriter = marketWriter; }
/// <summary> /// Initializes a new instance of the <see cref="IEntityDispatcher{ISportEvent}"/> class /// </summary> /// <param name="dispatcher">A <see cref="IEntityDispatcher{ISportEvent}" /> whose dispatched entities will be processed by the current instance</param> /// <param name="writer">A <see cref="SportEntityWriter" /> used to output / log the dispatched entities</param> /// <param name="marketWriter">A <see cref="MarketWriter"/> used to write market and outcome data</param> /// <param name="log">A <see cref="ILogger" /> instance used for logging</param> public EntityProcessor(IEntityDispatcher <T> dispatcher, SportEntityWriter writer = null, MarketWriter marketWriter = null, ILogger log = null) { Guard.Argument(dispatcher, nameof(dispatcher)).NotNull(); _dispatcher = dispatcher; _sportEntityWriter = writer; _marketWriter = marketWriter; _log = log ?? new NullLogger <EntityProcessor <T> >(); }
/// <summary> /// Initializes a new instance of the <see cref="SpecificEntityProcessor{T}"/> class /// </summary> /// <param name="log">A <see cref="ILog"/> instance used for logging</param> /// <param name="dispatcher">A <see cref="ISpecificEntityDispatcher{T}"/> used to obtain SDK messages</param> /// <param name="sportEntityWriter">A <see cref="SportEntityWriter"/> used to write the sport entities data</param> /// <param name="marketWriter">A <see cref="MarketWriter"/> used to write market and outcome data</param> public SpecificEntityProcessor(ILog log, ISpecificEntityDispatcher <T> dispatcher, SportEntityWriter sportEntityWriter = null, MarketWriter marketWriter = null) { Contract.Requires(dispatcher != null); Contract.Requires(log != null); _log = log; _dispatcher = dispatcher; _sportEntityWriter = sportEntityWriter; _marketWriter = marketWriter; }
/// <summary> /// Initializes a new instance of the <see cref="SpecificEntityProcessor{T}"/> class /// </summary> /// <param name="dispatcher">A <see cref="ISpecificEntityDispatcher{T}"/> used to obtain SDK messages</param> /// <param name="sportEntityWriter">A <see cref="SportEntityWriter"/> used to write the sport entities data</param> /// <param name="marketWriter">A <see cref="MarketWriter"/> used to write market and outcome data</param> /// <param name="log">A <see cref="ILogger"/> instance used for logging</param> public SpecificEntityProcessor(ISpecificEntityDispatcher <T> dispatcher, SportEntityWriter sportEntityWriter = null, MarketWriter marketWriter = null, ILogger log = null) { Guard.Argument(dispatcher, nameof(dispatcher)).NotNull(); Guard.Argument(log, nameof(log)).NotNull(); _log = log ?? SdkLoggerFactory.GetLogger(typeof(SpecificEntityProcessor <T>)); // new NullLogger<SpecificEntityProcessor<T>>(); _dispatcher = dispatcher; _sportEntityWriter = sportEntityWriter; _marketWriter = marketWriter; }
/// <summary> /// Initializes a new instance of the <see cref="SpecificEntityProcessor{T}"/> class /// </summary> /// <param name="log">A <see cref="ILog"/> instance used for logging</param> /// <param name="dispatcher">A <see cref="ISpecificEntityDispatcher{T}"/> used to obtain SDK messages</param> /// <param name="sportEntityWriter">A <see cref="SportEntityWriter"/> used to write the sport entities data</param> /// <param name="marketWriter">A <see cref="MarketWriter"/> used to write market and outcome data</param> public SpecificEntityProcessor(ILog log, ISpecificEntityDispatcher <T> dispatcher, SportEntityWriter sportEntityWriter = null, MarketWriter marketWriter = null) { Guard.Argument(dispatcher, nameof(dispatcher)).NotNull(); Guard.Argument(log, nameof(log)).NotNull(); _log = log; _dispatcher = dispatcher; _sportEntityWriter = sportEntityWriter; _marketWriter = marketWriter; }