forked from RevolutionPrep/resque-pubsub
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
86 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
require 'resque/plugins/pubsub/subscriber' | ||
require 'resque/plugins/pubsub/publisher' | ||
require 'resque/plugins/pubsub/broker' | ||
self.send(:include, Resque::Plugins::Pubsub::Subscriber) | ||
self.send(:include, Resque::Plugins::Pubsub::Publisher) | ||
|
||
require 'resque' | ||
Dir.glob(File.expand_path('resque/plugins/pubsub/*', File.dirname(__FILE__))).each { |filename| require filename } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class TestCustomSubscriber | ||
include Resque::Plugins::Pubsub::Subscriber | ||
|
||
subscribe 'test_custom_topic', :reader_method => :simple | ||
|
||
@@last_message = nil | ||
|
||
def self.simple(message) | ||
puts "[#{self.to_s}] got test custom topic message: #{message.inspect}" | ||
@@last_message = message | ||
end | ||
|
||
def self.last_message | ||
@@last_message | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class TestPublisher | ||
include Resque::Plugins::Pubsub::Publisher | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
class TestSubscriber | ||
require 'resque-pubsub' | ||
include Resque::Plugins::Pubsub::Subscriber | ||
|
||
subscribe 'test_topic' | ||
|
||
@@last_message = nil | ||
|
||
def self.read_test_topic_message(message) | ||
puts "got test topic message: #{message.inspect}" | ||
puts "[#{self.to_s}] got test topic message: #{message.inspect}" | ||
@@last_message = message | ||
end | ||
|
||
def self.last_message | ||
@@last_message | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.