Class: RedisIPC::Response

Inherits:
Object
  • Object
show all
Includes:
Concurrent::Concern::Obligation
Defined in:
lib/redis_ipc/response.rb

Class Method Summary collapse

Class Method Details

.fulfilled(content) ⇒ RedisIPC::Response

Creates a new fulfilled response with the provided data

Parameters:

  • content (Object)

    The data to set as the value for the response

Returns:



14
15
16
17
18
# File 'lib/redis_ipc/response.rb', line 14

def self.fulfilled(content)
  response = new
  response.send(:set_state, true, content, nil)
  response
end

.rejected(reason) ⇒ RedisIPC::Response

Creates a new rejected response with the provided reason

Parameters:

  • reason (Object)

    The reason why the request failed

Returns:



27
28
29
30
31
# File 'lib/redis_ipc/response.rb', line 27

def self.rejected(reason)
  response = new
  response.send(:set_state, false, nil, reason)
  response
end