Example #1
0
        /// <inheritdoc />
        public async Task <Task <string> > SubmitRequest(string url, CancellationToken token = default)
        {
            var tracked = new TrackedResult <string, string>(url, token);

            try
            {
                await _flow.SendAsync(tracked);
            }
            catch (Exception e)
            {
                _log.Errors.Add(e);
                _flow = new ConnectorFlow(Configuration.DataflowOptions, this);
                await _flow.SendAsync(tracked);
            }

            return(tracked.Task);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonConnector"/> class.
 /// </summary>
 /// <param name="log">Log service</param>
 public JsonConnector(ILog log)
 {
     _log  = log;
     _flow = new ConnectorFlow(Configuration.DataflowOptions, this);
 }