card-mod-delayed_job 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2828df0513116cba97bb4dfe252ccc72cf1013959fecf5bf268927673a04b314
4
+ data.tar.gz: e5c6b3bf8201daac37a55263ea2149b17dab8582903a293953f14977b5466088
5
+ SHA512:
6
+ metadata.gz: ca766b9dccbaaa33a211c31764d65c68719204ff97dbe6863301bd5f45a934f323b2a589953abfe8cff88272877421b58fd3620bdef7e4c610e35ad448afc076
7
+ data.tar.gz: 228b5b689011226d6821be7517818a4ccf1d00f8c679e235ab92309a6afd9f8fc2edc61aacc614e60d62feca8a9b2e3ecb6e958b9b2049b2a8da4736d775e3b0
@@ -0,0 +1,32 @@
1
+ This mod lets you run card events after sending an act response by using DelayedJobs.
2
+
3
+ Any card event defined in the `integrate_with_delay` stage will be handled after an act
4
+ is completed. For example, suppose you define a `notify` event in `integrate_with_delay`
5
+ that's intended to notify you when someone edits a card. With this mod, the email will
6
+ be sent _after_ the card is edited and the editor has received his web response.
7
+
8
+ At present you will need to add the following configuration to application.rb or an
9
+ environments.rb file:
10
+
11
+ config.active_job.queue_adapter = :delayed_job
12
+ config.delaying = true
13
+
14
+ You will then need to run a separate background process to process these events, eg:
15
+
16
+ script/delayed_job start
17
+
18
+ See https://github.com/collectiveidea/delayed_job#running-jobs for more info.
19
+
20
+
21
+ To have access to a web interface to inspect the jobs, add something like this
22
+ to `config/routes.rb`:
23
+
24
+ require 'decko/engine'
25
+ require 'delayed_job_web'
26
+
27
+ Rails.application.routes.draw do
28
+ mount DelayedJobWeb => "/*admin/delayed_job"
29
+ mount Decko::Engine => '/'
30
+ end
31
+
32
+ ...and then it will show up at `/*admin/delayed_job`.
@@ -0,0 +1,13 @@
1
+ return unless Cardio.config.active_job.queue_adapter == :delayed_job
2
+
3
+ Cardio.config.tap do |cc|
4
+ cc.delaying = true unless cc.delaying == false
5
+
6
+ Delayed::Worker.tap do |dw|
7
+ dw.delay_jobs = cc.delaying
8
+ dw.max_attempts = 1
9
+ dw.destroy_failed_jobs = false
10
+ end
11
+ end
12
+
13
+ Cardio.extend Cardio::DelayedJob
@@ -0,0 +1 @@
1
+ require "delayed_job_active_record"
@@ -0,0 +1,9 @@
1
+ module Cardio
2
+ # override default methods to handle DelayedJob needs
3
+ module DelayedJob
4
+ def delaying! on=true
5
+ super
6
+ Delayed::Worker.delay_jobs = Cardio.config.delaying
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: card-mod-delayed_job
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.11.0
5
+ platform: ruby
6
+ authors:
7
+ - Ethan McCutchen
8
+ - Philipp Kühl
9
+ - Gerry Gleason
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2020-12-24 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: card
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.101.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - '='
27
+ - !ruby/object:Gem::Version
28
+ version: 1.101.0
29
+ - !ruby/object:Gem::Dependency
30
+ name: daemons
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: delayed_job_active_record
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '4.1'
50
+ type: :runtime
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '4.1'
57
+ - !ruby/object:Gem::Dependency
58
+ name: delayed_job_web
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ description: ''
72
+ email:
73
+ - info@decko.org
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - README.md
79
+ - config/initializers/delayed_job_config.rb
80
+ - lib/card/mod/delayed_job.rb
81
+ - lib/cardio/delayed_job.rb
82
+ homepage: http://decko.org
83
+ licenses:
84
+ - GPL-3.0
85
+ metadata:
86
+ card-mod: delayed_job
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '2.5'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubygems_version: 3.0.3
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Background processing with Delayed Job
106
+ test_files: []