Module: QRPC

Defined in:
lib/qrpc/client.rb,
lib/qrpc/server.rb,
lib/qrpc/general.rb,
lib/qrpc/locator.rb,
lib/qrpc/client/job.rb,
lib/qrpc/server/job.rb,
lib/qrpc/generator/uuid.rb,
lib/qrpc/locator/em-jack.rb,
lib/qrpc/protocol/object.rb,
lib/qrpc/client/exception.rb,
lib/qrpc/client/dispatcher.rb,
lib/qrpc/protocol/abstract.rb,
lib/qrpc/protocol/json-rpc.rb,
lib/qrpc/server/dispatcher.rb,
lib/qrpc/generator/object-id.rb,
lib/qrpc/locator/evented-queue.rb,
lib/qrpc/protocol/object/error.rb,
lib/qrpc/protocol/abstract/error.rb,
lib/qrpc/protocol/json-rpc/error.rb,
lib/qrpc/protocol/object/request.rb,
lib/qrpc/protocol/abstract/object.rb,
lib/qrpc/protocol/object/response.rb,
lib/qrpc/protocol/abstract/request.rb,
lib/qrpc/protocol/json-rpc/request.rb,
lib/qrpc/protocol/abstract/response.rb,
lib/qrpc/protocol/json-rpc/response.rb,
lib/qrpc/protocol/json-rpc/native/qrpc-object.rb,
lib/qrpc/protocol/json-rpc/native/exception-data.rb

Overview

General QRPC module.

Defined Under Namespace

Modules: Generator, Locator, Protocol Classes: Client, Server

Constant Summary collapse

QUEUE_PREFIX =

Prefix for handled queues.

Since:

  • 0.1.1

"qrpc"
QUEUE_POSTFIX_INPUT =

Input queue postfix.

Since:

  • 0.1.1

"input"
QUEUE_POSTFIX_OUTPUT =

Output queue postfix.

Since:

  • 0.1.1

"output"
DEFAULT_PRIORITY =

Indicates default job priority.

Since:

  • 0.2.0

50
DEFAULT_GENERATOR =

Holds default generator module link.

Since:

  • 0.9.0

QRPC::Generator::UUID
@@default_protocol =

Holds default protocol instance.

Since:

  • 0.4.0

nil
@@default_generator =

Holds default generator instance.

Since:

  • 0.9.0

nil

Class Method Summary collapse

Class Method Details

.default_generatorQRPC::Generator::UUID

Returns default generator instance.

Returns:

Since:

  • 0.9.0



89
90
91
92
93
94
95
# File 'lib/qrpc/general.rb', line 89

def self.default_generator
    if @@default_generator.nil?
        @@default_generator = QRPC::DEFAULT_GENERATOR::new
    else
        @@default_generator
    end
end

.default_protocolQRPC::Protocol::Abstract

Returns default protocol instance.

Returns:

Since:

  • 0.9.0



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/qrpc/general.rb', line 68

def self.default_protocol
    if @@default_protocol.nil?
        begin
            @@default_protocol = QRPC::Protocol::JsonRpc::new(:serializer => JsonRpcObjects::Serializer::JSON::new)
        rescue NameError
            require "json-rpc-objects/serializer/json"  # >= 0.4.1
            require "qrpc/protocol/json-rpc"
            retry
        end
    else
        @@default_protocol
    end
end