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 Akka.Actor; | |
using Akka.Configuration; | |
using Akka.Routing; | |
namespace AkkaClustering | |
{ | |
public class JobCoordinatorActor : ReceiveActor | |
{ | |
public JobCoordinatorActor() |
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
at DotNetty.Transport.Channels.Sockets.SocketChannelAsyncOperation.Validate() | |
at DotNetty.Transport.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation) | |
at DotNetty.Transport.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation) | |
--- End of inner exception stack trace --- | |
--- End of inner exception stack trace --- | |
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) | |
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) | |
at DotNetty.Transport.Bootstrapping.Bootstrap.<DoResolveAndConnectAsync>d__15.MoveNext() |
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
internal sealed class ReplicatorMessageSerializer : SerializerWithStringManifest | |
{ | |
#region internal classes | |
/// <summary> | |
/// A cache that is designed for a small number (<= 32) of | |
/// entries. It is using instance equality. | |
/// Adding new entry overwrites oldest. It is | |
/// thread safe but duplicates of same entry may occur. |
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
// server | |
new ServerBootstrap() | |
.Group(serverEventLoopGroup) | |
.Option(ChannelOption.SoReuseaddr, Settings.TcpReuseAddr) | |
.Option(ChannelOption.SoKeepalive, Settings.TcpKeepAlive) | |
.Option(ChannelOption.TcpNodelay, Settings.TcpNoDelay) | |
.Option(ChannelOption.AutoRead, false) | |
.Option(ChannelOption.SoBacklog, Settings.Backlog) | |
.ChannelFactory(() => Settings.EnforceIpFamily | |
? new TcpServerSocketChannel(addressFamily) |
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.IO; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Threading.Tasks; | |
using DotNetty.Buffers; | |
using DotNetty.Codecs; | |
using DotNetty.Common.Internal.Logging; | |
using DotNetty.Handlers.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
using System; | |
using Akka.Actor; | |
using Akka.Configuration; | |
using Akka.Persistence.SqlServer; | |
namespace TestApp | |
{ | |
class Program | |
{ | |
public static void Main() |
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
Unhandled Exception: | |
System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: Invalid arguments | |
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00036] in <filename unknown>:0 | |
at DotNetty.Transport.Channels.Sockets.TcpServerSocketChannel.DoBind (System.Net.EndPoint localAddress) [0x00000] in <filename unknown>:0 | |
at DotNetty.Transport.Channels.AbstractChannel+AbstractUnsafe.BindAsync (System.Net.EndPoint localAddress) [0x00026] in <filename unknown>:0 | |
--- End of inner exception stack trace --- | |
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <filename unknown>:0 | |
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <filename unknown>:0 | |
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <filename unkn |
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
// we define two message-based protocols: one for data replication one for persistence | |
// those can be defined easily using discriminated union semantics | |
type ReplicationProtocol = | |
| Sync of Endpoint | |
| ReplicationProgess of ReplicaId * int | |
| Read of ReplicaId | |
| ReadRepair of ReplicaId | |
type PersistenceProtocol = | |
| Save of PersistenceId * byte[] |
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
type Command = Job of string | |
let active (count: int): Behavior<Command> = | |
Actor.behavior (fun ctx msg -> | |
match msg with | |
| Job payload -> | |
printfn "Received %s, current state: %d" payload count | |
// return updated state behavior, equivalent of become | |
active (count + 1)) | |
|> onSignal (fun ctx sig -> |
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 Akka.Actor; | |
using Akka.Configuration; | |
using Akka.Serialization.Protobuf; | |
using ProtoBuf; | |
namespace App | |
{ | |
/// <summary> | |
/// Interface used to recognize messages to be serialized by <see cref="ProtobufSerializer"/>. |