本文整理汇总了C#中Props类的典型用法代码示例。如果您正苦于以下问题:C# Props类的具体用法?C# Props怎么用?C# Props使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Props类属于命名空间,在下文中一共展示了Props类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:25,代码来源:Mailboxes.cs
示例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);
}
开发者ID:Badmoonz,项目名称:akka.net,代码行数:28,代码来源:RoutedActorCell.cs
示例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;
}
开发者ID:yaozd,项目名称:akka.net,代码行数:7,代码来源:RootGuardianActorRef.cs
示例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;
}
开发者ID:njimenez,项目名称:akka.net,代码行数:14,代码来源:RemoteSystemDaemon.cs
示例5: ActorCell
public ActorCell(ActorSystemImpl system, InternalActorRef self, Props props, MessageDispatcher dispatcher, InternalActorRef parent)
{
_self = self;
_props = props;
_systemImpl = system;
Parent = parent;
Dispatcher = dispatcher;
}
开发者ID:ClusterReply,项目名称:akka.net,代码行数:8,代码来源:ActorCell.cs
示例6: PlayerActor
public PlayerActor(string name, Props propsForUserInteracting, IActorRef reader)
{
_reader = reader;
_name = name;
_playerUserInterface = Context.ActorOf(propsForUserInteracting, "ui");
_reader.Tell(_playerUserInterface);
Become(Unregistered);
}
开发者ID:tpaananen,项目名称:AkkaBattleShip,代码行数:8,代码来源:PlayerActor.cs
示例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));
}
开发者ID:juergenhoetzel,项目名称:akka.net,代码行数:8,代码来源:ActorSelectionSpecs.cs
示例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));
}
开发者ID:promontis,项目名称:Even,代码行数:8,代码来源:IndexedProjectionStreamReader.cs
示例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;
}
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:9,代码来源:RepointableActorRef.cs
示例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);
}
开发者ID:mwatts,项目名称:Even,代码行数:9,代码来源:ProjectionStream.cs
示例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;
}
开发者ID:Micha-kun,项目名称:akka.net,代码行数:9,代码来源:RepointableActorRef.cs
示例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());
});
}
开发者ID:tpaananen,项目名称:AkkaBattleShip,代码行数:10,代码来源:ConsoleGuardianActor.cs
示例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();
}
开发者ID:promontis,项目名称:Even,代码行数:10,代码来源:EventStoreReader.cs
示例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);
}
开发者ID:rogeralsing,项目名称:akka.net,代码行数:13,代码来源:LocalActorRef.cs
示例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);
}
开发者ID:urmilaNominate,项目名称:mERP-framework,代码行数:10,代码来源:Neokernel.cs
示例16: RemoteActorRef
/// <summary>
/// Initializes a new instance of the <see cref="RemoteActorRef"/> class.
/// </summary>
/// <param name="remote">The remote.</param>
/// <param name="localAddressToUse">The local address to use.</param>
/// <param name="path">The path.</param>
/// <param name="parent">The parent.</param>
/// <param name="props">The props.</param>
/// <param name="deploy">The deploy.</param>
internal RemoteActorRef(RemoteTransport remote, Address localAddressToUse, ActorPath path, InternalActorRef parent,
Props props, Deploy deploy)
{
Remote = remote;
LocalAddressToUse = localAddressToUse;
Path = path;
_parent = parent;
_props = props;
_deploy = deploy;
}
开发者ID:pdoh00,项目名称:akka.net,代码行数:19,代码来源:RemoteActorRef.cs
示例17: ResizablePoolCell
public ResizablePoolCell(ActorSystemImpl system, IInternalActorRef self, Props routerProps, MessageDispatcher dispatcher, Props routeeProps, IInternalActorRef supervisor, Pool pool)
: base(system,self, routerProps,dispatcher, routeeProps, supervisor)
{
if (pool.Resizer == null) throw new ArgumentException("RouterConfig must be a Pool with defined resizer");
resizer = pool.Resizer;
_routerProps = routerProps;
_pool = pool;
_resizeCounter = new AtomicCounterLong(0);
_resizeInProgress = new AtomicBoolean();
}
开发者ID:MaciekLesiczka,项目名称:akka.net,代码行数:11,代码来源:ResizablePoolCell.cs
示例18: BackoffSupervisor
/// <summary>
/// Initializes a new instance of the <see cref="BackoffSupervisor"/> class.
/// </summary>
/// <exception cref="ArgumentException">
/// This exception is thrown if the given <paramref name="minBackoff"/> is negative or greater than <paramref name="maxBackoff"/>.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// This exception is thrown if the given <paramref name="randomFactor"/> isn't between 0.0 and 1.0.
/// </exception>
public BackoffSupervisor(Props childProps, string childName, TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor)
{
if (minBackoff <= TimeSpan.Zero) throw new ArgumentException("MinBackoff must be greater than 0", nameof(minBackoff));
if (maxBackoff < minBackoff) throw new ArgumentException("MaxBackoff must be greater than MinBackoff", nameof(maxBackoff));
if (randomFactor < 0.0 || randomFactor > 1.0) throw new ArgumentOutOfRangeException(nameof(randomFactor), "RandomFactor must be between 0.0 and 1.0");
_childProps = childProps;
_childName = childName;
_minBackoff = minBackoff;
_maxBackoff = maxBackoff;
_randomFactor = randomFactor;
}
开发者ID:Micha-kun,项目名称:akka.net,代码行数:21,代码来源:BackoffSupervisor.cs
示例19: ResizablePoolCell
public ResizablePoolCell(ActorSystem system, InternalActorRef supervisor, Props routerProps,
Props routeeProps, ActorPath path, Mailbox mailbox, Pool pool)
: base(system, supervisor, routerProps, routeeProps, path, mailbox)
{
if (pool.Resizer == null)
throw new ArgumentException("RouterConfig must be a Pool with defined resizer");
resizer = pool.Resizer;
this._pool = pool;
this._resizeCounter = 0;
this._resizeInProgress = ResizeInProgressState.False;
}
开发者ID:pdoh00,项目名称:akka.net,代码行数:12,代码来源:ResizablePoolCell.cs
示例20: ProcessArguments
private List<Query> ProcessArguments(ArrayList args, out Props props)
{
int capacity = (args != null) ? args.Count : 0;
List<Query> list = new List<Query>(capacity);
props = Props.None;
for (int i = 0; i < capacity; i++)
{
Props props2;
list.Add(this.ProcessNode((AstNode) args[i], Flags.None, out props2));
props |= props2;
}
return list;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:QueryBuilder.cs
注:本文中的Props类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论