Akka Types of dispatchers

Akka消息调度器详解
本文介绍了Akka框架中的四种消息调度器:Dispatcher、PinnedDispatcher和CallingThreadDispatcher。详细解释了每种调度器的特点、共享能力、邮箱类型及适用场景,并指出了它们分别由什么驱动。

Akka Types of dispatchers


There are 4 different types of message dispatchers:

• Dispatcher

– This is an event-based dispatcher that binds a set of Actors to a thread pool. It is the default dispatcher used if one is not specified.

– Sharability: Unlimited

– Mailboxes: Any, creates one per Actor

– Use cases: Default dispatcher, Bulkheading

Driven by: java.util.concurrent.ExecutorService specify using “executor” using “fork-join-executor”, “thread-pool-executor” or the FQCN of an

akka.dispatcher.ExecutorServiceConfigurator


• PinnedDispatcher

– This dispatcher dedicates a unique thread for each actor using it; i.e. each actor will have its own thread pool with only one thread in the pool.

– Sharability: None

– Mailboxes: Any, creates one per Actor

– Use cases: Bulkheading

– Driven by: Any akka.dispatch.ThreadPoolExecutorConfigurator by default a“thread-pool-executor”


• CallingThreadDispatcher

– This dispatcher runs invocations on the current thread only. This dispatcher does not create any new

threads, but it can be used from different threads concurrently for the same actor. See CallingThreadDispatcher for details and restrictions.

– Sharability: Unlimited

– Mailboxes: Any, creates one per Actor per Thread (on demand)

– Use cases: Testing

– Driven by: The calling thread (duh)


Akka官方文档中说有四个,只找到三个。

================END================

转载于:https://my.oschina.net/xinxingegeya/blog/367320

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值