public ExampleService(SenderLookup senderLookup, ReceiverLookup receiverLookup, IOptions <ExampleOptions> options) { if (string.IsNullOrEmpty(options.Value.Source)) { throw new ArgumentException("Invalid ExampleOptions: Source must have non-empty value.", nameof(options)); } _cloudEventSource = options.Value.Source; _userPipeSender = senderLookup("user-pipe"); _userPipeReceiver = receiverLookup("user-pipe"); _userPipeReceiver.Error += (obj, args) => { // Do something when the receiver ecounters an error throw new Exception($"Error in the user-pipe receiver: {args.Exception.Message}"); }; _workerPipe1Sender = senderLookup("worker-pipe-1"); _workerPipe1Receiver = receiverLookup("worker-pipe-1"); _workerPipe1Receiver.Error += (obj, args) => { // Do something when the receiver ecounters an error throw new Exception($"Error in the worker-pipe-1 receiver: {args.Exception.Message}"); }; _workerPipe2Sender = senderLookup("worker-pipe-2"); _workerPipe2Receiver = receiverLookup("worker-pipe-2"); _workerPipe2Receiver.Error += (obj, args) => { // Do something when the receiver ecounters an error throw new Exception($"Error in the worker-pipe-2 receiver: {args.Exception.Message}"); }; }
public ExampleService(SenderLookup senderLookup, ReceiverLookup receiverLookup, IOptions <ExampleOptions> options) { if (string.IsNullOrEmpty(options.Value.Source)) { throw new ArgumentException("Invalid ExampleOptions: Source must have non-empty value.", nameof(options)); } _cloudEventSource = new Uri(options.Value.Source, UriKind.RelativeOrAbsolute); _userPipeSender = senderLookup("user-pipe"); _userPipeReceiver = receiverLookup("user-pipe"); _workerPipe1Sender = senderLookup("worker-pipe-1"); _workerPipe1Receiver = receiverLookup("worker-pipe-1"); _workerPipe2Sender = senderLookup("worker-pipe-2"); _workerPipe2Receiver = receiverLookup("worker-pipe-2"); }