Created
February 14, 2017 09:11
-
-
Save mikeminutillo/d5706c68578b936dc6ffb7c588154211 to your computer and use it in GitHub Desktop.
Nsb V5 satellite that just repeats what it gets sent
This file contains 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
class EchoSatellite : ISatellite | |
{ | |
public bool Handle(TransportMessage message) | |
{ | |
string replyToAddress; | |
if (message.Headers.TryGetValue(Headers.ReplyToAddress, out replyToAddress)) | |
{ | |
dispatcher.Send(message, new SendOptions(replyToAddress)); | |
return true; | |
} | |
return false; | |
} | |
public void Start() { } | |
public void Stop() { } | |
public Address InputAddress => settings.LocalAddress().SubScope("echo"); | |
public bool Disabled => false; | |
private readonly ISendMessages dispatcher; | |
private readonly ReadOnlySettings settings; | |
public EchoSatellite(ISendMessages dispatcher, ReadOnlySettings settings) | |
{ | |
this.dispatcher = dispatcher; | |
this.settings = settings; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment