This eventually will allow catalog storage ("storeconfigs") to be taken out of
the critical request-handling path of puppetmasterd, such that:
* Puppet::Node::Catalog can be serialized to a message queue via the
indirector's "save" method
* a separate process can use Puppet::Node::Catalog::Queue.subscribe to pick up
these catalog objects as they come in and can save them to the database through
the :active_record terminus
Signed-off-by: Ethan Rowe <[email protected]>
---
lib/puppet/indirector/catalog/queue.rb | 5 +++++
spec/unit/indirector/catalog/queue.rb | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
create mode 100644 lib/puppet/indirector/catalog/queue.rb
create mode 100755 spec/unit/indirector/catalog/queue.rb
diff --git a/lib/puppet/indirector/catalog/queue.rb
b/lib/puppet/indirector/catalog/queue.rb
new file mode 100644
index 0000000..85d2f8d
--- /dev/null
+++ b/lib/puppet/indirector/catalog/queue.rb
@@ -0,0 +1,5 @@
+require 'puppet/node/catalog'
+require 'puppet/indirector/queue'
+
+class Puppet::Node::Catalog::Queue < Puppet::Indirector::Queue
+end
diff --git a/spec/unit/indirector/catalog/queue.rb
b/spec/unit/indirector/catalog/queue.rb
new file mode 100755
index 0000000..e47af31
--- /dev/null
+++ b/spec/unit/indirector/catalog/queue.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+require 'puppet/indirector/catalog/queue'
+
+describe Puppet::Node::Catalog::Queue do
+ it 'should be a subclass of the Queue terminus' do
+ Puppet::Node::Catalog::Queue.superclass.should
equal(Puppet::Indirector::Queue)
+ end
+
+ it 'should be registered with the catalog store indirection' do
+ indirection = Puppet::Indirector::Indirection.instance(:catalog)
+ Puppet::Node::Catalog::Queue.indirection.should equal(indirection)
+ end
+
+ it 'shall be dubbed ":queue"' do
+ Puppet::Node::Catalog::Queue.name.should == :queue
+ end
+end
--
1.5.5.1
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---