+rabbitmq-users — please keep the list on CC.
On 8 April 2015 at 06:06:28, Michael Watson (
mswa...@gmail.com) wrote:
> It's tempting to use the Parallel Task Library for executing
> parallel tasks in Orleans, but TPL uses the .NET thread pool to
> dispatch tasks. This is prohibited within Orleans 'grain' code
> (grains are the term for the actor objects that run within Orleans
> 'silos').
>
> Orleans has it's own task scheduler which provides a single threaded
> execution model used within grains. This means that objects
> running within the Orleans framework don't have to worry about
> mutexes, etc... But in order to scale, all interactions with
> the world outside the grain must support async/await. The whole
> silo runs with just a small number of threads, yet easily supports
> 100,000 active objects, scaling up linearly by adding new silos
> on new machines.
>
> There is a mechanism for starting subtasks that use Orleans'
> own scheduler. But since Rabbit's client.dll starts its own
> threads using the .Net scheduler, that almost certainly won't
> work.
>
> It's a shame, because Orleans offers a highly scalable actor
> framework with pluggable stream providers that support a number
> of other messaging providers, but RabbitMQ is the one I use. Paired
> with RabbitMQ services that live outside the Orleans framework,
> I believe Orleans could drastically simplify the building of
> apps that scale.
Luckily it's fairly trivial to make it possible to provide your own consumer
dispatcher implementation. In fact, I suspect it's already possible:
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/master/projects/client/RabbitMQ.Client/src/client/impl/Connection.cs#L105
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/master/projects/client/RabbitMQ.Client/src/client/impl/ConsumerWorkService.cs
default implementation:
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/master/projects/client/RabbitMQ.Client/src/client/impl/ConcurrentConsumerDispatcher.cs
Note that this implementation preserves per-channel dispatch ordering. While not a strict requirement,
this is generally a good idea.
Can we somehow support Orleans without requiring .NET 4.5?
--
MK
Staff Software Engineer, Pivotal/RabbitMQ