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
21 22 23 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 21 def instance @instance ||= new(1) end |
Instance Method Details
#execute(runnable) ⇒ Object
32 33 34 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 32 def execute(runnable) runnable.run end |
#shutdown ⇒ Object
36 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 36 def shutdown; end |
#shutdown_now ⇒ Object
38 39 40 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 38 def shutdown_now [] end |
#submit(runnable) ⇒ Object
26 27 28 29 30 |
# File 'lib/rspec/openhab/core/mocks/synchronous_executor.rb', line 26 def submit(runnable) runnable.respond_to?(:run) ? runnable.run : runnable.call java.util.concurrent.CompletableFuture.completed_future(nil) end |