Class: Iudex::BruteFuzzy::Service::Agent
- Inherits:
-
Object
- Object
- Iudex::BruteFuzzy::Service::Agent
- Includes:
- Iudex::BruteFuzzy, Core, SimHash::BruteFuzzy, RJack::QpidClient
- Defined in:
- lib/iudex-brutefuzzy-service/agent.rb
Instance Method Summary collapse
- #fuzzy_set ⇒ Object
-
#initialize ⇒ Agent
constructor
A new instance of Agent.
- #jms_connector(ctx) ⇒ Object
- #jms_context ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize ⇒ Agent
Returns a new instance of Agent.
33 34 35 |
# File 'lib/iudex-brutefuzzy-service/agent.rb', line 33 def initialize Hooker.apply( [ :iudex, :brutefuzzy_agent ], self ) end |
Instance Method Details
#fuzzy_set ⇒ Object
37 38 39 |
# File 'lib/iudex-brutefuzzy-service/agent.rb', line 37 def fuzzy_set FuzzyTree64.new( 500_000, 3, 16 ) end |
#jms_connector(ctx) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/iudex-brutefuzzy-service/agent.rb', line 47 def jms_connector( ctx ) connector = JMSConnector.new( ctx ) connector.max_connect_delay = java.lang.Integer::MAX_VALUE connector.do_close_connections = false connector end |
#jms_context ⇒ Object
41 42 43 44 45 |
# File 'lib/iudex-brutefuzzy-service/agent.rb', line 41 def jms_context ctx = QpidJMSContext.new Destinations.apply( ctx ) ctx end |
#run ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/iudex-brutefuzzy-service/agent.rb', line 54 def run ctx = jms_context Hooker.apply( [ :jms, :context ], ctx ) connector = jms_connector( ctx ) Hooker.apply( [ :jms, :connector ], connector ) service = Service.new( fuzzy_set ) Hooker.apply( [ :iudex, :brutefuzzy_service ], service ) Hooker.log_not_applied # All hooks should be used by now connector.add_connect_listener( service ) connector.connect_loop end |