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
#light | |
open Microsoft.FSharp.Control | |
let counter = | |
MailboxProcessor.Start(fun inbox -> | |
let rec loop() = | |
async { | |
let! msg = inbox.Scan(fun x -> | |
match x with |
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
namespace Crawling | |
{ | |
public class Crawler : Actor<Message>, ICrawlingHandler | |
{ | |
protected override void Receive(Message message) | |
{ | |
message(this); | |
} | |
public Crawler(Monitor monitor) |
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
namespace Strong | |
{ | |
using System; | |
using ActorLite; | |
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
new Ping(5).Start(new Pong()); |
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
namespace StrongCrawling | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using ActorLite; | |
public interface ICrawlRequestHandler | |
{ | |
void Crawl(Monitor monitor, string url); |
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
namespace Test | |
{ | |
using System; | |
using System.Collections.Generic; | |
using ActorLite; | |
public interface IPersonHandler | |
{ | |
void Chat(Person another, Topic topic); | |
void Eat(Restaurant restaurant); |
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
namespace StrongCrawling | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Text.RegularExpressions; | |
using ActorLite; | |
public interface ICrawlRequestHandler |
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
namespace Crawling | |
{ | |
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using ActorLite; |
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
static string DoPre(string content) | |
{ | |
return Regex.Replace(content, @"(<pre[^>]*>)([\s\S]*?)(</pre>)", match => | |
{ | |
return | |
match.Groups[1].Value + | |
String.Join("<br />", match.Groups[2].Value.Split('\n').Select(p => p.Replace(" ", " ").Trim()).ToArray()) + | |
match.Groups[3].Value; | |
}); | |
} |
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
public class AreaControllerFactory : IControllerFactory | |
{ | |
private Dictionary<string, string> m_areaPartMapping = new Dictionary<string, string>(); | |
private ReaderWriterLockSlim m_rwLock = new ReaderWriterLockSlim(); | |
private Dictionary<string, Type> m_controllerTypes = new Dictionary<string, Type>(); | |
public string NamespaceBase { get; private set; } | |
public AreaControllerFactory(string namespaceBase) | |
: this(namespaceBase, null) |
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
[AttributeUsage(AttributeTargets.All, AllowMultiple = true)] | |
public class AttachDataAttribute : Attribute | |
{ | |
public AttachDataAttribute(object key, object value) | |
{ | |
this.Key = key; | |
this.Value = value; | |
} | |
public AttachDataAttribute() { } |
OlderNewer