Class: Celluloid::AsyncCall

Inherits:
Call
  • Object
show all
Defined in:
lib/celluloid/calls.rb

Overview

Asynchronous calls don’t wait for a response

Instance Attribute Summary

Attributes inherited from Call

#arguments, #block, #caller, #method

Instance Method Summary collapse

Methods inherited from Call

#check_signature, #initialize

Constructor Details

This class inherits a constructor from Celluloid::Call

Instance Method Details

#dispatch(obj) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/celluloid/calls.rb', line 90

def dispatch(obj)
  begin
    check_signature(obj)
  rescue Exception => ex
    Logger.crash("#{obj.class}: async call `#{@method}' failed!", ex)
    return
  end

  obj.send(@method, *@arguments, &@block)
rescue AbortError => ex
  # Swallow aborted async calls, as they indicate the caller made a mistake
  Logger.crash("#{obj.class}: async call `#{@method}' aborted!", ex)
end