Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public void ChannelExecutor_default_should_be_overriden_by_config()
{
var config = ConfigurationFactory.ParseString(@"
executor = channel-executor
channel-executor.priority = high");
channel-executor.priority = normal");
var configurator = new ChannelExecutorConfigurator(config, Sys.Dispatchers.Prerequisites);
configurator.Priority.Should().Be(TaskSchedulerPriority.High);
configurator.Priority.Should().Be(TaskSchedulerPriority.Normal);
}

[Fact]
Expand All @@ -59,7 +59,7 @@ public async Task ChannelExecutor_instantiation_should_not_throw_when_config_doe
dispatcher.Configurator.Config.GetString("executor").Should().Be("channel-executor");

var configurator = new ChannelExecutorConfigurator(dispatcher.Configurator.Config, Sys.Dispatchers.Prerequisites);
configurator.Priority.Should().Be(TaskSchedulerPriority.Normal);
configurator.Priority.Should().Be(TaskSchedulerPriority.High);

await sys.Terminate();
}
Expand Down
9 changes: 7 additions & 2 deletions src/core/Akka/Configuration/Pigeon.conf
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,12 @@ akka {
# - "thread-pool-executor" requires a "thread-pool-executor" section
# - "current-context-executor" requires a "current-context-executor" section
# - "task-executor" requires a "task-executor" section
# - "channel-executor" requires a "channel-executor" section
# - A FQCN of a class extending ExecutorServiceConfigurator
executor = "default-executor"

# This will be used if you have set "executor = "default-executor"".
# Uses the default .NET threadpool
# Uses the default .NET channel executor
default-executor {
}

Expand All @@ -340,6 +341,10 @@ akka {
task-peeking-mode = "FIFO"
}

channel-executor {
priority = "high"
}

# For running in current synchronization contexts
current-context-executor{}

Expand Down Expand Up @@ -369,7 +374,7 @@ akka {
# default dispatcher)
internal-dispatcher {
type = "Dispatcher"
executor = "fork-join-executor"
executor = "channel-executor"
throughput = 5

fork-join-executor {
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka/Dispatch/AbstractDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ protected ExecutorServiceConfigurator ConfigureExecutor()
case null:
case "":
case "default-executor":
case "channel-executor":
return new ChannelExecutorConfigurator(Config, Prerequisites);
case "thread-pool-executor":
return new ThreadPoolExecutorServiceFactory(Config, Prerequisites);
case "fork-join-executor":
Expand All @@ -337,8 +339,6 @@ protected ExecutorServiceConfigurator ConfigureExecutor()
return new CurrentSynchronizationContextExecutorServiceFactory(Config, Prerequisites);
case "task-executor":
return new DefaultTaskSchedulerExecutorConfigurator(Config, Prerequisites);
case "channel-executor":
return new ChannelExecutorConfigurator(Config, Prerequisites);
default:
Type executorConfiguratorType = Type.GetType(executor);
if (executorConfiguratorType == null)
Expand Down