Module: CitrusRpc::RpcClient::Router

Included in:
Client
Defined in:
lib/citrus-rpc/rpc-client/router.rb

Overview

Router

Instance Method Summary collapse

Instance Method Details

#ch_route(client, server_type, msg, &block) ⇒ Object

Consistent-Hash algorithm for calculating server id

Parameters:

  • client (Object)
  • server_type (String)
  • msg (Hash)


59
60
# File 'lib/citrus-rpc/rpc-client/router.rb', line 59

def ch_route client, server_type, msg, &block
end

#df_route(session, msg, context, &block) ⇒ Object

Calculate route info and return an appropriate server id

Parameters:

  • session (Object)
  • msg (Hash)
  • context (Object)


19
20
# File 'lib/citrus-rpc/rpc-client/router.rb', line 19

def df_route session, msg, context, &block
end

#la_route(client, server_type, msg, &block) ⇒ Object

Least-Active algorithm for calculating server id

Parameters:

  • client (Object)
  • server_type (String)
  • msg (Hash)


51
52
# File 'lib/citrus-rpc/rpc-client/router.rb', line 51

def la_route client, server_type, msg, &block
end

#rd_route(client, server_type, msg, &block) ⇒ Object

Random algorithm for calculating server id

Parameters:

  • client (Object)
  • server_type (String)
  • msg (Hash)


27
28
# File 'lib/citrus-rpc/rpc-client/router.rb', line 27

def rd_route client, server_type, msg, &block
end

#rr_route(client, server_type, msg, &block) ⇒ Object

Round-Robin algorithm for calculating server id

Parameters:

  • client (Object)
  • server_type (String)
  • msg (Hash)


35
36
# File 'lib/citrus-rpc/rpc-client/router.rb', line 35

def rr_route client, server_type, msg, &block
end

#wrr_route(client, server_type, msg, &block) ⇒ Object

Weight-Round-Robin algorithm for calculating server id

Parameters:

  • client (Object)
  • server_type (String)
  • msg (Hash)


43
44
# File 'lib/citrus-rpc/rpc-client/router.rb', line 43

def wrr_route client, server_type, msg, &block
end