pub 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm --create use 1.9.2@pub
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in queue.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ Jotting down the idea:
2
+
3
+ # Configure
4
+
5
+ Pub.redis = "localhost:6379"
6
+ Pub.expires_in = 900
7
+
8
+ # Subscriber: A request
9
+
10
+ Queue["foo"].subscribe("1234") do |resp|
11
+ puts resp
12
+ end
13
+
14
+ # Publisher: A background worker
15
+
16
+ queue = Queue["foo"]
17
+ # Process up to 10 requests at a time
18
+ reqs = queue.pop(10)
19
+ process(reqs) do |req, resp|
20
+ queue.publish(req, resp)
21
+ end
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,3 @@
1
+ module Pub
2
+ VERSION = "0.0.1"
3
+ end
data/lib/pub.rb ADDED
@@ -0,0 +1,14 @@
1
+ begin
2
+ require "yajl"
3
+ rescue LoadError
4
+ require "json"
5
+ end
6
+
7
+ require "redis/connection/synchrony"
8
+ require "redis"
9
+
10
+ require "pub/version"
11
+
12
+ module Pub
13
+ # Your code goes here...
14
+ end
data/pub.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "pub/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "pub"
7
+ s.version = Pub::VERSION
8
+ s.authors = ["Hakan Ensari"]
9
+ s.email = ["hakan.ensari@papercavalier.com"]
10
+ s.homepage = "http://rubygems.com/papercavalier/pub"
11
+ s.summary = %q{A Redis-backed pub/sub messaging system that processes queues}
12
+ s.description = %q{Pub is a Redis-backed pub/sub messaging system that process queues.}
13
+
14
+ s.rubyforge_project = "pub"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ {
22
+ "eventmachine" => "~> 1.0.0.beta.3",
23
+ "em-synchrony" => "~> 0.3.0.beta.1",
24
+ "hiredis" => "~> 0.3.2",
25
+ "redis" => "~> 2.2.0"
26
+ }.each do |lib, version|
27
+ s.add_runtime_dependency lib, version
28
+ end
29
+
30
+ {
31
+ "rspec" => "~> 2.6.0"
32
+ }.each do |lib, version|
33
+ s.add_development_dependency lib, version
34
+ end
35
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'rspec'
4
+
5
+ require File.expand_path('../../lib/pub', __FILE__)
6
+
7
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pub
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Hakan Ensari
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-06-08 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: eventmachine
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 0
31
+ - 0
32
+ - beta
33
+ - 3
34
+ version: 1.0.0.beta.3
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: em-synchrony
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ segments:
46
+ - 0
47
+ - 3
48
+ - 0
49
+ - beta
50
+ - 1
51
+ version: 0.3.0.beta.1
52
+ type: :runtime
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: hiredis
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ - 3
65
+ - 2
66
+ version: 0.3.2
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: redis
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ segments:
78
+ - 2
79
+ - 2
80
+ - 0
81
+ version: 2.2.0
82
+ type: :runtime
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
85
+ name: rspec
86
+ prerelease: false
87
+ requirement: &id005 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ~>
91
+ - !ruby/object:Gem::Version
92
+ segments:
93
+ - 2
94
+ - 6
95
+ - 0
96
+ version: 2.6.0
97
+ type: :development
98
+ version_requirements: *id005
99
+ description: Pub is a Redis-backed pub/sub messaging system that process queues.
100
+ email:
101
+ - hakan.ensari@papercavalier.com
102
+ executables: []
103
+
104
+ extensions: []
105
+
106
+ extra_rdoc_files: []
107
+
108
+ files:
109
+ - .gitignore
110
+ - .rvmrc
111
+ - Gemfile
112
+ - README.md
113
+ - Rakefile
114
+ - lib/pub.rb
115
+ - lib/pub/version.rb
116
+ - pub.gemspec
117
+ - spec/spec_helper.rb
118
+ has_rdoc: true
119
+ homepage: http://rubygems.com/papercavalier/pub
120
+ licenses: []
121
+
122
+ post_install_message:
123
+ rdoc_options: []
124
+
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ segments:
133
+ - 0
134
+ version: "0"
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ segments:
141
+ - 0
142
+ version: "0"
143
+ requirements: []
144
+
145
+ rubyforge_project: pub
146
+ rubygems_version: 1.3.7
147
+ signing_key:
148
+ specification_version: 3
149
+ summary: A Redis-backed pub/sub messaging system that processes queues
150
+ test_files:
151
+ - spec/spec_helper.rb