本文整理汇总了C#中Akka.Actor.Address.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Address.ToString方法的具体用法?C# Address.ToString怎么用?C# Address.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Akka.Actor.Address
的用法示例。
在下文中一共展示了Address.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Ready
private void Ready()
{
Receive<SendState>(msg =>
{
_cluster.SendCurrentClusterState(Self);
});
Receive<ClusterEvent.CurrentClusterState>(state =>
{
//_hub.ClusterState(state, _cluster.SelfAddress);
});
Receive<RemoveMe>(msg => {
_logger.Warning("[l] Monitor stopping; Issuing a Cluster.Leave() command for following address: {0}", _cluster.SelfAddress);
_cluster.Leave(_cluster.SelfAddress);
});
Receive<MemberLeave>(msg => {
Address add = new Address(msg.Protocol, msg.System, msg.Host, msg.Port);
_logger.Warning("[l] Forcing Member to leave cluster: {0}", add.ToString());
_cluster.Leave(add);
});
Receive<MemberDown>(msg => {
Address add = new Address(msg.Protocol, msg.System, msg.Host, msg.Port);
_logger.Warning("[l] Forcing the Member down: {0}", add.ToString());
_cluster.Down(add);
});
}
示例2: RemoveClusterMember
public void RemoveClusterMember(Address address)
{
using (var cmd = new SQLiteCommand(@"DELETE FROM cluster_nodes WHERE member_address = @addr", _connectionFactory()))
using (var tx = cmd.Connection.BeginTransaction())
{
cmd.Transaction = tx;
var addr = address.ToString();
cmd.Parameters.Add("@addr", DbType.String);
cmd.Parameters["@addr"].Value = addr;
cmd.ExecuteNonQuery();
tx.Commit();
}
}
示例3: AddClusterMember
public void AddClusterMember(Address address)
{
using (var cmd = new SQLiteCommand(@"INSERT INTO cluster_nodes(member_address) VALUES (@addr)", _connectionFactory()))
using (var tx = cmd.Connection.BeginTransaction())
{
cmd.Transaction = tx;
var addr = address.ToString();
cmd.Parameters.Add("@addr", DbType.String);
cmd.Parameters["@addr"].Value = addr;
cmd.ExecuteNonQuery();
tx.Commit();
}
}
示例4: Ready
private void Ready()
{
Receive<RemoveMember>(mem =>
{
_logger.Warning("Service stopping; Issuing a Cluster.Leave() command for following address: {0}", Cluster.SelfAddress);
Cluster.Leave(Cluster.SelfAddress);
});
Receive<MemberDown>(address =>
{
Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
_logger.Warning("Forcing the Member down: {0}", add.ToString());
Cluster.Down(add);
});
Receive<MemberLeave>(address =>
{
Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
_logger.Warning("Forcing Member to leave cluster: {0}", add.ToString());
Cluster.Leave(add);
});
}
示例5: Ready
private void Ready()
{
Receive<RemoveMember>(mem =>
{
_logger.Info("Removing Member: {0}", Cluster.SelfAddress);
Cluster.Leave(Cluster.SelfAddress);
});
Receive<MemberDown>(address =>
{
Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
_logger.Info("Forcing the Member down: {0}", add.ToString());
Cluster.Down(add);
});
Receive<MemberLeave>(address =>
{
Address add = new Address(address.Protocol, address.System, address.Host, address.Port);
_logger.Info("Forcing Member to leave cluster: {0}", add.ToString());
Cluster.Leave(add);
});
}
示例6: Encode
/// <summary>
/// URL-encodes an actor <see cref="Address"/>. Used when generating the names
/// of some system remote actors.
/// </summary>
public static string Encode(Address address)
{
return HttpUtility.UrlEncode(address.ToString(), Encoding.UTF8);
}
示例7: CreateEndpoint
private InternalActorRef CreateEndpoint(Address recipientAddress, AkkaProtocolTransport transport,
Address localAddressToUse, long? refuseUid)
{
string escapedAddress = Uri.EscapeDataString(recipientAddress.ToString());
string name = string.Format("endpointWriter-{0}-{1}", escapedAddress, endpointId++);
InternalActorRef actor =
Context.ActorOf(
Props.Create(
() => new EndpointActor(localAddressToUse, recipientAddress, transport.Transport, settings)),
name);
return actor;
}