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.Threading.Tasks; | |
| namespace NDSandbox | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| } |
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
| var person = function(opt) { | |
| var obj = {} | |
| obj.name = opt.name || "NA"; | |
| obj.age = opt.age || "NA"; | |
| obj.getDescription = function(){ | |
| return this.name + " " + this.age; | |
| } |
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
| ``` | |
| get_some_data(paramThingy) = | |
| SomeActor ! {self(), {get_stuff, paramThingy}, | |
| receive | |
| {From, Res} -> Res | |
| end. | |
| ``` | |
| %% client code deals with interface paramThingy -> resultType. Simple / complicated / hierarchical / fault tolerant processing via messages is done underneath. But client code can deal with the api without knowing all messaging nitty - gritty. Since it's all async, and Erlang does selective receive, this "blocking" (it's really non-blocking async) code isn't problematic. |
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 Contra; | |
| namespace ConsoleApplication8 | |
| { | |
| public interface Envelope<out T> {T Message { get; } } | |
| public class MessageEnvelope<T> : Envelope<T> | |
| { |
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
| class RabbitMQEventNotifier(host:String, exchange:String, routingKey:String, username:String, password:String, virtualHost:String) | |
| extends EventNotifier with Serializable { | |
| private def createChannel () = { | |
| val factory = new ConnectionFactory() | |
| factory.setUsername(username) | |
| factory.setPassword(password) | |
| factory.setVirtualHost(virtualHost) | |
| factory.setHost(host) | |
| val connection = factory.newConnection() | |
| connection.createChannel() |
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
| class RmqReceiver(uname:String, | |
| passwd: String, | |
| vHost:String, | |
| host:String, | |
| qName:String, | |
| topic:Option[String]) | |
| extends Receiver[Array[Byte]](StorageLevel.MEMORY_AND_DISK_2) with Logging { | |
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
| { | |
| "TotalResults": 14, | |
| "TotalPages": 3, | |
| "Page": 1, | |
| "_links": { | |
| "self": { | |
| "href": "/beers?page=1" | |
| }, | |
| "next": { | |
| "href": "/beers?page=2" |
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
| namespace Syndication.Client.Http | |
| { | |
| public class CachingAdapter : HttpClientAdapter | |
| { | |
| readonly HttpClient client; | |
| public CachingAdapter(ICacheStore cacheStore, string[] defaultVaryHeaders) | |
| { | |
| //http://msdn.microsoft.com/en-us/library/system.net.cache.requestcachelevel(v=vs.110).aspx | |
| //http://blog.technovert.com/2013/01/httpclient-caching/ |
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.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using dokimi.core; | |
| using dokimi.core.dokimi.core.Specs.MessageBased; | |
| using dokimi.core.Specs.MessageBased; | |
| using dokimi.nunit; | |
| using Infura; |
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 VigilEngine | |
| { | |
| private readonly Beam _beam; | |
| public VigilEngine(Beam beam) | |
| { | |
| _beam = beam; | |
| Console.WriteLine("Creating engine. {0}", Thread.CurrentThread.ManagedThreadId); | |
| while (true) |