exceptional_synchrony 1.0.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.dependabot/config.yml +10 -0
- data/.gitignore +2 -0
- data/.jenkins/Jenkinsfile +58 -0
- data/.jenkins/ruby_build_pod.yml +19 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +29 -0
- data/Gemfile +11 -1
- data/Gemfile.lock +116 -104
- data/Rakefile +11 -0
- data/exceptional_synchrony.gemspec +20 -22
- data/lib/exceptional_synchrony.rb +0 -1
- data/lib/exceptional_synchrony/callback_exceptions.rb +36 -4
- data/lib/exceptional_synchrony/event_machine_proxy.rb +71 -7
- data/lib/exceptional_synchrony/limited_work_queue.rb +29 -5
- data/lib/exceptional_synchrony/parallel_sync.rb +1 -0
- data/lib/exceptional_synchrony/version.rb +1 -1
- data/test/test_helper.rb +12 -0
- data/test/unit/callback_exceptions_test.rb +67 -15
- data/test/unit/event_machine_proxy_test.rb +132 -19
- data/test/unit/limited_work_queue_test.rb +221 -23
- data/test/unit/parallel_sync_test.rb +6 -6
- metadata +39 -90
- data/Thorfile +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d067a2b3a9635740dbee2374a06e772c29ca9a8fe57a61108c94118ac15480bb
|
4
|
+
data.tar.gz: 665f4bf8ccc1ea699c0d56a4f7d38647c2e3e64e814b736562bf83b69ccd0d25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9961b1ef53acfb4c94651611871b120279dab3b3564e1841b199a7b2fa1f7a3728bca945517f50964704b0491f9a086192cb857a3205c6008758ecb51a4fb9c5
|
7
|
+
data.tar.gz: 0a4d64204faf45276aaca59757ad43bb850c75ea668671e92eae251721a19c6b2ce0ecae5b3bb38c8a64179ba41d0b0864bf1a6640de4e234c4c772434bcfca0
|
data/.gitignore
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/groovy
|
2
|
+
@Library('jenkins-pipeline@v0.4.5')
|
3
|
+
import com.invoca.docker.*;
|
4
|
+
pipeline {
|
5
|
+
agent {
|
6
|
+
kubernetes {
|
7
|
+
defaultContainer "ruby"
|
8
|
+
yamlFile ".jenkins/ruby_build_pod.yml"
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
environment {
|
13
|
+
GITHUB_TOKEN = credentials('github_token')
|
14
|
+
GITHUB_KEY = credentials('github_key')
|
15
|
+
BUNDLE_GEM__FURY__IO = credentials('gemfury_deploy_token')
|
16
|
+
}
|
17
|
+
|
18
|
+
stages {
|
19
|
+
stage('Setup') {
|
20
|
+
steps {
|
21
|
+
updateGitHubStatus('clean-build', 'pending', 'Unit tests.')
|
22
|
+
script {
|
23
|
+
sh '''
|
24
|
+
# get SSH setup inside the container
|
25
|
+
eval `ssh-agent -s`
|
26
|
+
echo "$GITHUB_KEY" | ssh-add -
|
27
|
+
mkdir -p /root/.ssh
|
28
|
+
ssh-keyscan -t rsa github.com > /root/.ssh/known_hosts
|
29
|
+
bundle install
|
30
|
+
''' }
|
31
|
+
}
|
32
|
+
}
|
33
|
+
stage('Unit Test') {
|
34
|
+
steps {
|
35
|
+
script {
|
36
|
+
sh 'bundle exec rake'
|
37
|
+
}
|
38
|
+
}
|
39
|
+
post {
|
40
|
+
always { junit '*/reports/*.xml' }
|
41
|
+
success { updateGitHubStatus('clean-build', 'success', 'Unit tests.') }
|
42
|
+
failure { updateGitHubStatus('clean-build', 'failure', 'Unit tests.') }
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
void updateGitHubStatus(String context, String status, String description) {
|
49
|
+
gitHubStatus([
|
50
|
+
repoSlug: 'Invoca/exceptional_synchrony',
|
51
|
+
sha: env.GIT_COMMIT,
|
52
|
+
description: description,
|
53
|
+
context: context,
|
54
|
+
targetURL: env.RUN_DISPLAY_URL,
|
55
|
+
token: env.GITHUB_TOKEN,
|
56
|
+
status: status
|
57
|
+
])
|
58
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
apiVersion: v1
|
3
|
+
kind: Pod
|
4
|
+
metadata:
|
5
|
+
labels:
|
6
|
+
jenkins/exceptional-synchrony: 'true'
|
7
|
+
namespace: jenkins
|
8
|
+
name: exceptional-synchrony
|
9
|
+
spec:
|
10
|
+
containers:
|
11
|
+
- name: ruby
|
12
|
+
image: ruby:2.6.5
|
13
|
+
tty: true
|
14
|
+
resources:
|
15
|
+
requests:
|
16
|
+
memory: "100Mi"
|
17
|
+
command:
|
18
|
+
- cat
|
19
|
+
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.5
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# CHANGELOG for `exception_synchrony`
|
2
|
+
|
3
|
+
Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
4
|
+
|
5
|
+
Note: This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
All notable changes to this project will be documented in this file.
|
8
|
+
|
9
|
+
## [1.3.0] - 2021-02-04
|
10
|
+
### Added
|
11
|
+
- Extend `EMP.defer` to have a new keyword argument, `wait_for_result` for the callers to control whether they should should block until the background thread returns. To preserve existing behavior, this option defaults to `true`, so `EMP.defer` will block in order to return the value (or raise an exception) from the deferred block. Callers can pass `wait_for_result: false` if they do not want to block.
|
12
|
+
|
13
|
+
## [1.2.0] - 2020-06-02
|
14
|
+
### Changed
|
15
|
+
- If `EMP.run` rescues an exception, previous versions would simply log the exception and continue.
|
16
|
+
Instead this version has an `on_error` option with possible values `:log` and `:raise`.
|
17
|
+
It defaults to `:log` and in that case, as before, logs any rescued `StandardError` exception and continues.
|
18
|
+
When `on_error` is set to `:raise`, the method raises a `FatalRunError` wrapper around the rescued exception.
|
19
|
+
This `FatalRunError` exception does not derive from `StandardError`, so it will not be erroneously rescued by any
|
20
|
+
registered `EMP.error_handler`. Instead it should be rescued at the outer edge of the process.
|
21
|
+
We expect that outer edge handler to log the exception chain (the wrapper plus nested `cause` exception(s))
|
22
|
+
and exit the process with a non-0 status code.
|
23
|
+
|
24
|
+
## [1.1.1] - 2020-05-03
|
25
|
+
- Replace hobo_support with invoca_utils
|
26
|
+
|
27
|
+
[1.3.0]: https://github.com/Invoca/exceptional_synchrony/compare/v1.2.0...v1.3.0
|
28
|
+
[1.2.0]: https://github.com/Invoca/exceptional_synchrony/compare/v1.1.1...v1.2.0
|
29
|
+
[1.1.1]: https://github.com/Invoca/exceptional_synchrony/compare/v1.1.0...v1.1.1
|
data/Gemfile
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in attr_default.gemspec
|
6
6
|
gemspec
|
7
|
+
|
8
|
+
group :development do
|
9
|
+
gem 'minitest'
|
10
|
+
gem 'minitest-reporters'
|
11
|
+
gem 'pry'
|
12
|
+
gem 'rake'
|
13
|
+
gem 'rr', '~> 1.2'
|
14
|
+
gem 'thor'
|
15
|
+
gem 'webmock', '~> 1.24'
|
16
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,121 +1,127 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
exceptional_synchrony (1.0
|
4
|
+
exceptional_synchrony (1.3.0)
|
5
5
|
em-http-request
|
6
|
-
em-synchrony
|
7
|
-
eventmachine
|
8
|
-
exception_handling
|
9
|
-
|
6
|
+
em-synchrony
|
7
|
+
eventmachine
|
8
|
+
exception_handling (~> 2.2)
|
9
|
+
invoca-utils (~> 0.3)
|
10
10
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
actionmailer (
|
15
|
-
actionpack (=
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
rack
|
25
|
-
rack-test (
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
i18n (
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
14
|
+
actionmailer (6.1.1)
|
15
|
+
actionpack (= 6.1.1)
|
16
|
+
actionview (= 6.1.1)
|
17
|
+
activejob (= 6.1.1)
|
18
|
+
activesupport (= 6.1.1)
|
19
|
+
mail (~> 2.5, >= 2.5.4)
|
20
|
+
rails-dom-testing (~> 2.0)
|
21
|
+
actionpack (6.1.1)
|
22
|
+
actionview (= 6.1.1)
|
23
|
+
activesupport (= 6.1.1)
|
24
|
+
rack (~> 2.0, >= 2.0.9)
|
25
|
+
rack-test (>= 0.6.3)
|
26
|
+
rails-dom-testing (~> 2.0)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
28
|
+
actionview (6.1.1)
|
29
|
+
activesupport (= 6.1.1)
|
30
|
+
builder (~> 3.1)
|
31
|
+
erubi (~> 1.4)
|
32
|
+
rails-dom-testing (~> 2.0)
|
33
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
34
|
+
activejob (6.1.1)
|
35
|
+
activesupport (= 6.1.1)
|
36
|
+
globalid (>= 0.3.6)
|
37
|
+
activesupport (6.1.1)
|
38
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
39
|
+
i18n (>= 1.6, < 2)
|
40
|
+
minitest (>= 5.1)
|
41
|
+
tzinfo (~> 2.0)
|
42
|
+
zeitwerk (~> 2.3)
|
43
|
+
addressable (2.7.0)
|
44
|
+
public_suffix (>= 2.0.2, < 5.0)
|
45
|
+
ansi (1.5.0)
|
46
|
+
builder (3.2.4)
|
47
|
+
coderay (1.1.2)
|
48
|
+
concurrent-ruby (1.1.8)
|
49
|
+
contextual_logger (0.11.0)
|
50
|
+
activesupport
|
51
|
+
json
|
52
|
+
cookiejar (0.3.3)
|
53
|
+
crack (0.4.3)
|
54
|
+
safe_yaml (~> 1.0.0)
|
55
|
+
crass (1.0.6)
|
56
|
+
em-http-request (1.1.7)
|
48
57
|
addressable (>= 2.3.4)
|
49
|
-
cookiejar
|
58
|
+
cookiejar (!= 0.3.1)
|
50
59
|
em-socksify (>= 0.3)
|
51
60
|
eventmachine (>= 1.0.3)
|
52
61
|
http_parser.rb (>= 0.6.0)
|
53
|
-
em-socksify (0.3.
|
62
|
+
em-socksify (0.3.2)
|
54
63
|
eventmachine (>= 1.0.0.beta.4)
|
55
|
-
em-synchrony (1.0.
|
64
|
+
em-synchrony (1.0.6)
|
56
65
|
eventmachine (>= 1.0.0.beta.1)
|
57
|
-
|
58
|
-
eventmachine (1.
|
59
|
-
exception_handling (
|
60
|
-
actionmailer (
|
61
|
-
actionpack (
|
62
|
-
activesupport (
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
66
|
+
erubi (1.10.0)
|
67
|
+
eventmachine (1.2.7)
|
68
|
+
exception_handling (2.8.1)
|
69
|
+
actionmailer (>= 4.2, < 7.0)
|
70
|
+
actionpack (>= 4.2, < 7.0)
|
71
|
+
activesupport (>= 4.2, < 7.0)
|
72
|
+
contextual_logger (~> 0.7)
|
73
|
+
eventmachine (~> 1.0)
|
74
|
+
invoca-utils (~> 0.3)
|
75
|
+
globalid (0.4.2)
|
76
|
+
activesupport (>= 4.2.0)
|
77
|
+
hashdiff (1.0.1)
|
67
78
|
http_parser.rb (0.6.0)
|
68
|
-
i18n (
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
rack
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
rr (1.1
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
tilt (1.4.1)
|
112
|
-
treetop (1.4.15)
|
113
|
-
polyglot
|
114
|
-
polyglot (>= 0.3.1)
|
115
|
-
tzinfo (0.3.38)
|
116
|
-
webmock (1.17.1)
|
117
|
-
addressable (>= 2.2.7)
|
79
|
+
i18n (1.8.7)
|
80
|
+
concurrent-ruby (~> 1.0)
|
81
|
+
invoca-utils (0.4.1)
|
82
|
+
json (2.5.1)
|
83
|
+
loofah (2.9.0)
|
84
|
+
crass (~> 1.0.2)
|
85
|
+
nokogiri (>= 1.5.9)
|
86
|
+
mail (2.7.1)
|
87
|
+
mini_mime (>= 0.1.1)
|
88
|
+
method_source (1.0.0)
|
89
|
+
mini_mime (1.0.2)
|
90
|
+
mini_portile2 (2.5.0)
|
91
|
+
minitest (5.14.0)
|
92
|
+
minitest-reporters (1.4.2)
|
93
|
+
ansi
|
94
|
+
builder
|
95
|
+
minitest (>= 5.0)
|
96
|
+
ruby-progressbar
|
97
|
+
nokogiri (1.11.1)
|
98
|
+
mini_portile2 (~> 2.5.0)
|
99
|
+
racc (~> 1.4)
|
100
|
+
pry (0.13.1)
|
101
|
+
coderay (~> 1.1)
|
102
|
+
method_source (~> 1.0)
|
103
|
+
public_suffix (4.0.4)
|
104
|
+
racc (1.5.2)
|
105
|
+
rack (2.2.3)
|
106
|
+
rack-test (1.1.0)
|
107
|
+
rack (>= 1.0, < 3)
|
108
|
+
rails-dom-testing (2.0.3)
|
109
|
+
activesupport (>= 4.2.0)
|
110
|
+
nokogiri (>= 1.6)
|
111
|
+
rails-html-sanitizer (1.3.0)
|
112
|
+
loofah (~> 2.3)
|
113
|
+
rake (13.0.1)
|
114
|
+
rr (1.2.1)
|
115
|
+
ruby-progressbar (1.10.1)
|
116
|
+
safe_yaml (1.0.5)
|
117
|
+
thor (1.0.1)
|
118
|
+
tzinfo (2.0.4)
|
119
|
+
concurrent-ruby (~> 1.0)
|
120
|
+
webmock (1.24.6)
|
121
|
+
addressable (>= 2.3.6)
|
118
122
|
crack (>= 0.3.2)
|
123
|
+
hashdiff
|
124
|
+
zeitwerk (2.4.2)
|
119
125
|
|
120
126
|
PLATFORMS
|
121
127
|
ruby
|
@@ -123,6 +129,12 @@ PLATFORMS
|
|
123
129
|
DEPENDENCIES
|
124
130
|
exceptional_synchrony!
|
125
131
|
minitest
|
126
|
-
|
132
|
+
minitest-reporters
|
133
|
+
pry
|
134
|
+
rake
|
135
|
+
rr (~> 1.2)
|
127
136
|
thor
|
128
|
-
webmock (~> 1.
|
137
|
+
webmock (~> 1.24)
|
138
|
+
|
139
|
+
BUNDLED WITH
|
140
|
+
1.17.3
|
data/Rakefile
CHANGED
@@ -1,26 +1,24 @@
|
|
1
1
|
require File.expand_path('../lib/exceptional_synchrony/version', __FILE__)
|
2
2
|
|
3
|
-
Gem::Specification.new do |
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'exceptional_synchrony'
|
5
|
+
spec.date = '2014-01-16'
|
6
|
+
spec.summary = 'Extensions to EventMachine/Synchrony to work well with exceptions'
|
7
|
+
spec.description = %q{}
|
8
|
+
spec.authors = ['Invoca']
|
9
|
+
spec.email = 'development@invoca.com'
|
10
|
+
spec.homepage = 'https://github.com/Invoca/exceptional_synchrony'
|
11
|
+
spec.license = 'MIT'
|
12
|
+
spec.files = `git ls-files`.split($/)
|
13
|
+
spec.version = ExceptionalSynchrony::VERSION
|
14
|
+
spec.metadata = {
|
15
|
+
"source_code_uri" => "https://github.com/Invoca/exceptional_synchrony",
|
16
|
+
"allowed_push_host" => "https://rubygems.org"
|
17
|
+
}
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
gem.add_development_dependency 'thor'
|
22
|
-
gem.add_development_dependency 'minitest'
|
23
|
-
gem.add_development_dependency 'webmock', '~> 1.17.1'
|
24
|
-
|
25
|
-
gem.add_development_dependency 'rr', '~> 1.1.2'
|
19
|
+
spec.add_dependency 'em-synchrony'
|
20
|
+
spec.add_dependency 'em-http-request'
|
21
|
+
spec.add_dependency 'eventmachine'
|
22
|
+
spec.add_dependency 'exception_handling', '~> 2.2'
|
23
|
+
spec.add_dependency 'invoca-utils', '~> 0.3'
|
26
24
|
end
|