Class: RSpec::OpenHAB::Core::Mocks::SynchronousExecutor
- Inherits:
-
Object
- Object
- RSpec::OpenHAB::Core::Mocks::SynchronousExecutor
- Defined in:
- lib/rspec/openhab/core/mocks/synchronous_executor.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.instance ⇒ Object
19 20 21 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 19 def instance @instance ||= new(1) end |
Instance Method Details
#execute(runnable) ⇒ Object
30 31 32 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 30 def execute(runnable) runnable.run end |
#shutdown ⇒ Object
34 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 34 def shutdown; end |
#shutdown_now ⇒ Object
36 37 38 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 36 def shutdown_now [] end |
#submit(runnable) ⇒ Object
24 25 26 27 28 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 24 def submit(runnable) runnable.respond_to?(:run) ? runnable.run : runnable.call java.util.concurrent.CompletableFuture.completed_future(nil) end |