本文整理汇总了C#中LanguageExt.ProcessId.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ProcessId.ToString方法的具体用法?C# ProcessId.ToString怎么用?C# ProcessId.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LanguageExt.ProcessId
的用法示例。
在下文中一共展示了ProcessId.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMessage
internal static RemoteMessageDTO CreateMessage(object message, ProcessId to, ProcessId sender, Message.Type type, Message.TagSpec tag) =>
new RemoteMessageDTO()
{
Type = (int)type,
Tag = (int)tag,
To = to.Path,
RequestId = -1,
MessageId = Guid.NewGuid(),
Sender = sender.ToString(),
ReplyTo = sender.ToString(),
ContentType = message == null
? null
: message.GetType().AssemblyQualifiedName,
Content = message == null
? null
: JsonConvert.SerializeObject(message, ActorConfig.Default.JsonSerializerSettings)
};
示例2: ProcessFmt
private static string ProcessFmt(ProcessId pid) =>
pid.IsValid
? pid.ToString()
: "no-sender";
示例3: CreateMessage
internal static RemoteMessageDTO CreateMessage(object message, ProcessId to, ProcessId sender, Message.Type type, Message.TagSpec tag, Option<SessionId> sessionId) =>
new RemoteMessageDTO
{
Type = (int)type,
Tag = (int)tag,
To = to.ToString(),
RequestId = -1,
MessageId = Guid.NewGuid(),
Sender = sender.ToString(),
ReplyTo = sender.ToString(),
ContentType = message == null
? null
: message.GetType().AssemblyQualifiedName,
Content = message == null
? null
: JsonConvert.SerializeObject(message, ActorSystemConfig.Default.JsonSerializerSettings),
SessionId = sessionId.Map(s => s.Value).IfNoneUnsafe(() => null)
};
示例4: CreateResponse
internal static RemoteMessageDTO CreateResponse(ActorResponse res, ProcessId to, ProcessId sender, Option<SessionId> sessionId) =>
new RemoteMessageDTO
{
Type = (int)Message.Type.User,
Tag = (int)Message.TagSpec.UserReply,
Child = null,
Exception = res.IsFaulted
? "RESPERR"
: null,
To = to.ToString(),
RequestId = res.RequestId,
MessageId = Guid.NewGuid(),
Sender = res.ReplyFrom.ToString(),
ReplyTo = res.ReplyTo.ToString(),
ContentType = res.Message.GetType().AssemblyQualifiedName,
Content = JsonConvert.SerializeObject(res.Message, ActorSystemConfig.Default.JsonSerializerSettings),
SessionId = sessionId.Map(s => s.Value).IfNoneUnsafe(() => null)
};
示例5: CreateRequest
internal static RemoteMessageDTO CreateRequest(ActorRequest req, ProcessId to, ProcessId sender) =>
new RemoteMessageDTO
{
Type = (int)Message.Type.User,
Tag = (int)Message.TagSpec.UserAsk,
Child = null,
Exception = null,
To = to.Path,
RequestId = req.RequestId,
MessageId = Guid.NewGuid(),
Sender = sender.ToString(),
ReplyTo = req.ReplyTo.ToString(),
ContentType = req.Message.GetType().AssemblyQualifiedName,
Content = JsonConvert.SerializeObject(req.Message, ActorSystemConfig.Default.JsonSerializerSettings)
};