philostler/acts_as_executor — Issue #20: No validation for invalid schedulable executor with nil max_tasks
Author: philostler
Created: 2011-10-08 23:54:24+00:00
State: open
Labels: bug

Due to there being no implementation of a cached schedulable executor e.g. ```factory.rb```

```ruby
if schedulable
if max_tasks == nil
# No Cached Scheduled Implementation
elsif max_tasks > 1
executor = Java::java.util.concurrent.Executors.new_scheduled_thread_pool max_tasks.to_i # Scheduled
else
executor = Java::java.util.concurrent.Executors.new_single_thread_scheduled_executor # Single Scheduled
end
else...
```

The following attempt to create an executor should not pass validation

```ruby
Executor.create :name => "scheduled", :schedulable => true
```

The following line is valid

```ruby
Executor.create :name => "scheduled", :schedulable => true, :max_tasks => 5
```

The current implementation creates an endless startup loop due to ```executor``` never being set.