resque_delivery 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/lib/resque_delivery.rb +5 -5
- data/resque_delivery.gemspec +1 -1
- metadata +2 -1
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -31,7 +31,7 @@ You can configure 2 additional options in your resque_delivery_settings hash:
|
|
31
31
|
|
32
32
|
## Notes
|
33
33
|
|
34
|
-
We serialize the Mail::Message object
|
34
|
+
We serialize the Mail::Message object so that you can pass objects to your Mailer classes. Other similar
|
35
35
|
implementations of asynchronous mailing, queue the Mailer name with the mail parameters, building the email parts at send time. This
|
36
36
|
implementation allows our workers to be unaware of any data models or views that are required to build the email. Additionally, no further
|
37
37
|
code changes are required to make your mails asynchronous (well, assuming you already have Resque configured).
|
data/lib/resque_delivery.rb
CHANGED
@@ -16,21 +16,21 @@ class ResqueDelivery
|
|
16
16
|
|
17
17
|
def deliver!(mail)
|
18
18
|
# serialize the mail object for later sending
|
19
|
-
Resque.enqueue_to(queue, job_class, delivery_method, mail.
|
19
|
+
Resque.enqueue_to(queue, job_class, delivery_method, mail.encoded)
|
20
20
|
end
|
21
21
|
|
22
22
|
class SendMail
|
23
23
|
@queue = :medium
|
24
24
|
|
25
25
|
class << self
|
26
|
-
def perform(delivery_method,
|
27
|
-
real_delivery_method(delivery_method).deliver!(build_message(
|
26
|
+
def perform(delivery_method, mail_text)
|
27
|
+
real_delivery_method(delivery_method).deliver!(build_message(mail_text))
|
28
28
|
end
|
29
29
|
protected
|
30
30
|
|
31
31
|
# deserialize the mail object
|
32
|
-
def build_message(
|
33
|
-
Mail
|
32
|
+
def build_message(mail_text)
|
33
|
+
Mail.new(mail_text)
|
34
34
|
end
|
35
35
|
|
36
36
|
def real_delivery_method(delivery_method)
|
data/resque_delivery.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque_delivery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -51,6 +51,7 @@ extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
53
|
- .gitignore
|
54
|
+
- Gemfile
|
54
55
|
- README.md
|
55
56
|
- lib/resque_delivery.rb
|
56
57
|
- resque_delivery.gemspec
|