X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmcollective%2Fconnector%2Fbase.rb;fp=lib%2Fmcollective%2Fconnector%2Fbase.rb;h=4eabae3604963e6581cef3faa08c88afbba1cc6e;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/lib/mcollective/connector/base.rb b/lib/mcollective/connector/base.rb new file mode 100644 index 0000000..4eabae3 --- /dev/null +++ b/lib/mcollective/connector/base.rb @@ -0,0 +1,24 @@ +module MCollective + # Connector plugins handle the communications with the middleware, you can provide your own to speak + # to something other than Stomp, your plugins must inherit from MCollective::Connector::Base and should + # provide the following methods: + # + # connect - Creates a connection to the middleware, no arguments should get its parameters from the config + # receive - Receive data from the middleware, should act like a blocking call only returning if/when data + # was received. It should get data from all subscribed channels/topics. Individual messages + # should be returned as MCollective::Request objects with the payload provided + # publish - Takes a target and msg, should send the message to the supplied target topic or destination + # subscribe - Adds a subscription to a specific message source + # unsubscribe - Removes a subscription to a specific message source + # disconnect - Disconnects from the middleware + # + # These methods are all that's needed for a new connector protocol and should hopefully be simple + # enough to not have tied us to Stomp. + module Connector + class Base + def self.inherited(klass) + PluginManager << {:type => "connector_plugin", :class => klass.to_s} + end + end + end +end