- Node - a physical or virtual machine that hosts services
- Nodes also referred to as members.
- Examples
- Your computer
- An AWS EC2 instance
- A bare metal machine in your private data center
- Service - executing software that provides utility via an interface
- Typically long-lived process listening on a port(s)
- Examples
- A web server (nginx, apache, iis)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Interface segregation (Combined Mixin+Non-mixin) | |
| // For no-mixins version see https://gist.github.com/benaadams/d35ff5c534a43fd6c89d | |
| // For mixins/generic constraints version see https://gist.github.com/benaadams/77c6e7aa34aae92b876a | |
| // Do something with sync Reading, Seeking, Disposable stream (Generic Constraints) | |
| public static void DoSomething<T>(T stream) where T : IBlockingReader, ISeekable, ISizable, IDisposable | |
| { | |
| stream.ReadByte(); | |
| stream.SetLength(6); | |
| stream.Position = 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq; | |
| using Autofac; | |
| using Autofac.Core; | |
| namespace Autofac.Logging | |
| { | |
| /// <summary> | |
| /// Sets up automatic DI for service dependencies on <typeparamref name="TLogger"/>, | |
| /// via an external factory that resolves based on the type of the resolver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AsyncMediatorPipeline<TRequest, TResponse> : IAsyncRequestHandler<TRequest, TResponse> where TRequest : IAsyncRequest<TResponse> | |
| { | |
| private readonly IAsyncRequestHandler<TRequest, TResponse> inner; | |
| private readonly IAsyncPreRequestHandler<TRequest>[] preRequestHandlers; | |
| private readonly IAsyncPostRequestHandler<TRequest, TResponse>[] postRequestHandlers; | |
| public AsyncMediatorPipeline(IAsyncRequestHandler<TRequest, TResponse> inner, IAsyncPreRequestHandler<TRequest>[] preRequestHandlers, IAsyncPostRequestHandler<TRequest, TResponse>[] postRequestHandlers) | |
| { | |
| this.inner = inner; |
$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using SampleApi.Results; | |
| using System; | |
| using System.Net.Http; | |
| using System.Web.Http; | |
| namespace SampleApi | |
| { | |
| public static class IHttpActionResultExtensions | |
| { | |
| public static IHttpActionResult With(this IHttpActionResult inner, string responsePhrase = null, Action<HttpResponseMessage> responseAction = null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |