Class: Hoodoo::Services::Discovery::ByFlux

Inherits:
Hoodoo::Services::Discovery show all
Defined in:
lib/hoodoo/services/discovery/discoverers/by_flux.rb

Overview

Discover resource endpoint locations via Alchemy Flux.

For Flux, it’s less about discovery as it is about convention and announcing. We have to set some system variables when the application starts up, before the Rack ‘run` call gets as far as the Alchemy Flux server’s implementation - in practice this means announcement needs to happen from the Hoodoo middleware’s constructor, synchronously. The environment variables tell Flux about this local service’s URI-located endpoints and derive a consistent, replicable ‘service name’ from the resources which the service implements.

Once all that is set up, the local Alchemy instance knows how to listen for relevant messages for ‘this’ service on the queue and Hoodoo in ‘this’ service knowns which resources are local, or which are remote; and it knows that Flux is able in turn to use URI-based to-resource communications for inter-resource calls without any further explicit discovery within Hoodoo beyond simply saying “here’s the AMQP Flux endpoint class”.

Method Summary

Methods inherited from Hoodoo::Services::Discovery

#announce, #discover, #initialize, #is_local?

Constructor Details

This class inherits a constructor from Hoodoo::Services::Discovery