本文整理汇总了C#中Props类的典型用法代码示例。如果您正苦于以下问题:C# Props类的具体用法?C# Props怎么用?C# Props使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Props类属于命名空间,在下文中一共展示了Props类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMailboxType
public Type GetMailboxType(Props props, Config dispatcherConfig)
{
if (!string.IsNullOrEmpty(props.Mailbox))
{
return FromConfig(props.Mailbox);
}
var actortype = props.Type;
var interfaces = actortype.GetInterfaces()
.Where(i => i.IsGenericType)
.Where(i => i.GetGenericTypeDefinition() == typeof (RequiresMessageQueue<>))
.Select(i => i.GetGenericArguments().First())
.ToList();
if (interfaces.Count > 0)
{
var config = _requirementsMapping[interfaces.First()];
var mailbox = config.GetString("mailbox-type");
var mailboxType = Type.GetType(mailbox);
return mailboxType;
}
return FromConfig(DefaultMailboxId);
}
示例2: RoutedActorCell
public RoutedActorCell(ActorSystem system, InternalActorRef supervisor, Props routerProps, Props routeeProps, ActorPath path,
Mailbox mailbox)
: base(system, supervisor, routerProps, path, mailbox)
{
RouteeProps = routeeProps;
routerConfig = routerProps.RouterConfig;
Router = routerConfig.CreateRouter(system);
routerConfig.Match()
.With<Pool>(r =>
{
var routees = new List<Routee>();
for (int i = 0; i < r.NrOfInstances; i++)
{
var routee = this.ActorOf(RouteeProps);
routees.Add(new ActorRefRoutee(routee));
}
AddRoutees(routees.ToArray());
})
.With<Group>(r =>
{
var routees = routerConfig.GetRoutees(this).ToArray();
AddRoutees(routees);
});
Self = new RoutedActorRef(path, this);
}
示例3: RootGuardianActorRef
public RootGuardianActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, //TODO: switch from Func<Mailbox> createMailbox to MailboxType mailboxType
IInternalActorRef supervisor, ActorPath path, IInternalActorRef deadLetters, IReadOnlyDictionary<string, IInternalActorRef> extraNames)
: base(system,props,dispatcher,createMailbox,supervisor,path)
{
_deadLetters = deadLetters;
_extraNames = extraNames;
}
示例4: DaemonMsgCreate
/// <summary>
/// Initializes a new instance of the <see cref="DaemonMsgCreate" /> class.
/// </summary>
/// <param name="props">The props.</param>
/// <param name="deploy">The deploy.</param>
/// <param name="path">The path.</param>
/// <param name="supervisor">The supervisor.</param>
public DaemonMsgCreate(Props props, Deploy deploy, string path, IActorRef supervisor)
{
Props = props;
Deploy = deploy;
Path = path;
Supervisor = supervisor;
}
示例5: ActorCell
public ActorCell(ActorSystemImpl system, InternalActorRef self, Props props, MessageDispatcher dispatcher, InternalActorRef parent)
{
_self = self;
_props = props;
_systemImpl = system;
Parent = parent;
Dispatcher = dispatcher;
}
示例6: PlayerActor
public PlayerActor(string name, Props propsForUserInteracting, IActorRef reader)
{
_reader = reader;
_name = name;
_playerUserInterface = Context.ActorOf(propsForUserInteracting, "ui");
_reader.Tell(_playerUserInterface);
Become(Unregistered);
}
示例7: Setup
public void Setup(BenchmarkContext context)
{
_selectionOpCounter = context.GetCounter(ActorSelectionCounterName);
System = ActorSystem.Create("MailboxThroughputSpecBase" + Counter.GetAndIncrement());
_receiver = System.ActorOf(Props.Create(() => new BenchmarkActor(_selectionOpCounter, NumberOfMessages, _resetEvent)));
_receiverActorPath = _receiver.Path;
_oneMessageBenchmarkProps = Props.Create(() => new BenchmarkActor(_selectionOpCounter, 1, _resetEvent));
}
示例8: IndexedProjectionStreamReader
public IndexedProjectionStreamReader(IEventStoreReader reader, PersistedEventFactory factory)
{
Argument.Requires(reader != null, nameof(reader));
Argument.Requires(factory != null, nameof(factory));
_workerProps = Props.Create<ReadIndexedProjectionStreamWorker>(reader, factory);
Receive<ReadIndexedProjectionStreamRequest>(r => HandleRequest(r));
}
示例9: RepointableActorRef
public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path)
{
_system = system;
_props = props;
_dispatcher = dispatcher;
_createMailbox = createMailbox;
_supervisor = supervisor;
_path = path;
}
示例10: CreateProps
public static Props CreateProps(ProjectionStreamQuery query, IActorRef reader, IActorRef writer, GlobalOptions options, Props replayWorkerProps = null)
{
Argument.RequiresNotNull(query, nameof(query));
Argument.RequiresNotNull(reader, nameof(reader));
Argument.RequiresNotNull(writer, nameof(writer));
Argument.RequiresNotNull(options, nameof(options));
return Props.Create<ProjectionStream>(query, reader, writer, options, replayWorkerProps);
}
示例11: RepointableActorRef
public RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, MailboxType mailboxType, IInternalActorRef supervisor, ActorPath path)
{
System = system;
Props = props;
Dispatcher = dispatcher;
MailboxType = mailboxType;
Supervisor = supervisor;
_path = path;
}
示例12: ConsoleGuardianActor
public ConsoleGuardianActor()
{
_reader = Context.ActorOf(Props.Create(() => new ConsoleReaderActor()), "reader");
_consoleUi = Props.Create(() => new ConsoleActor());
Receive<Message.CreatePlayer>(message =>
{
Context.ActorOf(Props.Create(() => new PlayerActor(message.Name, _consoleUi, _reader)), (++_counter).ToString());
});
}
示例13: EventStoreReader
public EventStoreReader(IEventStore store, IPersistedEventFactory factory, GlobalOptions options)
{
_readProps = ReadWorker.CreateProps(store, factory);
_readStreamProps = ReadStreamWorker.CreateProps(store, factory);
_readIndexedProjectionProps = ReadIndexedProjectionStreamWorker.CreateProps(store, factory);
_readProjectionCheckpointProps = ReadProjectionCheckpointWorker.CreateProps(store);
_readHighestGlobalSequenceProps = ReadHighestGlobalSequenceWorker.CreateProps(store);
Ready();
}
示例14: LocalActorRef
/// <summary>
/// Inheritors should only call this constructor
/// </summary>
internal protected LocalActorRef(ActorSystem system, Props props, MessageDispatcher dispatcher, Func<Mailbox> createMailbox, IInternalActorRef supervisor, ActorPath path, Func<LocalActorRef, ActorCell> createActorCell) //TODO: switch from Func<Mailbox> createMailbox to MailboxType mailboxType
{
_system = system;
_props = props;
_dispatcher = dispatcher;
_createMailbox = createMailbox;
_supervisor = supervisor;
_path = path;
_cell = createActorCell(this);
}
示例15: createAgent
public virtual AgentControllerInterface createAgent(object agentInfo)
{
if (agentInfo is Props)
{
return this.createAgent((Props) agentInfo);
}
Props agentProps = new Props();
agentProps.setProperty("classname", agentInfo.ToString());
return this.createAgent(agentProps);
}