Пример #1
0
        public EmailService(IByteCodecService byteCodec, IClockService clock)
            : base(byteCodec.CastTo <IByteCodecService, NetworkServiceBase>(nameof(byteCodec)))
        {
            _byteCodec = byteCodec;
            _clock     = clock;

            SendCompletedCallback = (sender, e) =>
            {
                // e.UserState = userToken
                if (e.Error.IsNotNull())
                {
                    Logger.LogError(e.Error, e.Error.AsInnerMessage());
                }
            };
        }
Пример #2
0
 /// <summary>
 /// 构造一个 <see cref="HttpWebRequester"/>。
 /// </summary>
 /// <param name="byteCodec">给定的 <see cref="IByteCodecService"/>。</param>
 public HttpWebRequester(IByteCodecService byteCodec)
     : base(byteCodec, priority: 2)
 {
 }
Пример #3
0
 /// <summary>
 /// 构造一个 <see cref="UriRequesterBase"/>。
 /// </summary>
 /// <param name="byteCodec">给定的 <see cref="IByteCodecService"/>。</param>
 /// <param name="priority">给定的服务优先级(数值越小越优先)。</param>
 protected UriRequesterBase(IByteCodecService byteCodec, float priority)
     : base(byteCodec.CastTo <IByteCodecService, NetworkServiceBase>(nameof(byteCodec)))
 {
     ByteCodec = byteCodec;
     Priority  = priority;
 }
Пример #4
0
 /// <summary>
 /// 构造一个 <see cref="HttpClientRequester"/>。
 /// </summary>
 /// <param name="factory">给定的 <see cref="IHttpClientFactory"/>。</param>
 /// <param name="byteCodec">给定的 <see cref="IByteCodecService"/>。</param>
 public HttpClientRequester(IHttpClientFactory factory, IByteCodecService byteCodec)
     : base(byteCodec, priority: 1)
 {
     Factory = factory.NotNull(nameof(factory));
 }