Module: Swift::Adapter::Synchrony
Defined Under Namespace
Instance Method Summary collapse
-
#execute(*args) {|res| ... } ⇒ Object
Execute a command asynchronously and pause the Fiber until the command finishes.
- #transaction(&block) ⇒ Object
Instance Method Details
#execute(*args) {|res| ... } ⇒ Object
Execute a command asynchronously and pause the Fiber until the command finishes.
24 25 26 27 28 29 30 31 32 |
# File 'lib/swift/adapter/synchrony.rb', line 24 def execute *args res = ::EM::Synchrony.sync super(*args) if res.kind_of?(Error) res.set_backtrace caller.reject {|subject| subject =~ %r{swift/fiber_connection_pool}} raise res end yield res if block_given? res end |