phobos_temp_fork 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.dockerignore +13 -0
  3. data/.env +1 -0
  4. data/.gitignore +16 -0
  5. data/.rspec +3 -0
  6. data/.rubocop.yml +26 -0
  7. data/.rubocop_common.yml +29 -0
  8. data/.rubocop_todo.yml +7 -0
  9. data/.rubosync.yml +2 -0
  10. data/.ruby-version +1 -0
  11. data/.travis.yml +37 -0
  12. data/CHANGELOG.md +170 -0
  13. data/Dockerfile +14 -0
  14. data/Gemfile +8 -0
  15. data/LICENSE.txt +176 -0
  16. data/README.md +699 -0
  17. data/Rakefile +8 -0
  18. data/bin/console +19 -0
  19. data/bin/phobos +10 -0
  20. data/bin/setup +8 -0
  21. data/config/phobos.yml.example +137 -0
  22. data/docker-compose.yml +28 -0
  23. data/examples/handler_saving_events_database.rb +51 -0
  24. data/examples/handler_using_async_producer.rb +17 -0
  25. data/examples/publishing_messages_without_consumer.rb +82 -0
  26. data/lib/phobos/actions/process_batch.rb +35 -0
  27. data/lib/phobos/actions/process_batch_inline.rb +61 -0
  28. data/lib/phobos/actions/process_message.rb +49 -0
  29. data/lib/phobos/batch_handler.rb +23 -0
  30. data/lib/phobos/batch_message.rb +21 -0
  31. data/lib/phobos/cli.rb +69 -0
  32. data/lib/phobos/cli/runner.rb +48 -0
  33. data/lib/phobos/cli/start.rb +71 -0
  34. data/lib/phobos/constants.rb +33 -0
  35. data/lib/phobos/deep_struct.rb +39 -0
  36. data/lib/phobos/echo_handler.rb +11 -0
  37. data/lib/phobos/errors.rb +6 -0
  38. data/lib/phobos/executor.rb +103 -0
  39. data/lib/phobos/handler.rb +23 -0
  40. data/lib/phobos/instrumentation.rb +25 -0
  41. data/lib/phobos/listener.rb +192 -0
  42. data/lib/phobos/log.rb +23 -0
  43. data/lib/phobos/processor.rb +67 -0
  44. data/lib/phobos/producer.rb +171 -0
  45. data/lib/phobos/test.rb +3 -0
  46. data/lib/phobos/test/helper.rb +29 -0
  47. data/lib/phobos/version.rb +5 -0
  48. data/lib/phobos_temp_fork.rb +175 -0
  49. data/logo.png +0 -0
  50. data/phobos.gemspec +69 -0
  51. data/phobos_boot.rb +31 -0
  52. data/utils/create-topic.sh +13 -0
  53. metadata +308 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 604672918b8ef8468f236c87b4ec130fb3617307dd8e5e8030d9ad8d0f957c58
4
+ data.tar.gz: fadecf36b9cdb58f19ca704f6a51e31e29b8322f0eba947968ca7321ba6e0d2e
5
+ SHA512:
6
+ metadata.gz: 9151d7837cdffa5ab4516dd75127738e31ca301d60fb5e25404020dc9b5ac105b692e903e849ccaafb45398b56cb4ae21431917e5b3a1df140dd361c7b50b19d
7
+ data.tar.gz: b1f559126524f4a9595835e1329194cb2b708a1a93ea4b22d6d5d686cad1ec497ad6d685dd3be2e57a8a20cf1626e84cdb4e99d7155cfbad00d444c45aef8932
data/.dockerignore ADDED
@@ -0,0 +1,13 @@
1
+ .idea
2
+ .DS_Store
3
+ .dockerignore
4
+ .gitignore
5
+ .travis.yml
6
+ Dockerfile
7
+ docker-compose.yml
8
+ Gemfile.lock
9
+ logo.png
10
+ log/
11
+ coverage/
12
+ spec/examples.txt
13
+ pkg/
data/.env ADDED
@@ -0,0 +1 @@
1
+ DEFAULT_TIMEOUT=10
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ spec/examples.txt
10
+ /tmp/
11
+ .DS_Store
12
+ config/*.yml
13
+ log/*.log
14
+ .byebug_history
15
+ .idea
16
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --backtrace
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ ###########################
2
+ # Configuration for rubocop
3
+ # in .rubocop.yml
4
+
5
+ ##############
6
+ # Global rules
7
+ # see .rubocop_common.yml
8
+
9
+ ##############
10
+ # Inherit default rules first, and then override those rules with
11
+ # our violation whitelist.
12
+ inherit_from:
13
+ - .rubocop_common.yml
14
+ - .rubocop_todo.yml
15
+
16
+ ##############
17
+ # Project specific overrides here, example:
18
+ # Metrics/BlockLength:
19
+ # Exclude:
20
+ # - 'tasks/the_huge_task.rake'
21
+
22
+ AllCops:
23
+ Exclude:
24
+ - spec/**/*
25
+ - examples/**/*
26
+ TargetRubyVersion: 2.3
@@ -0,0 +1,29 @@
1
+ ##############
2
+ # Global rules
3
+ AllCops:
4
+ Exclude:
5
+ - db/**/*
6
+ TargetRubyVersion: 2.3
7
+
8
+ Rails:
9
+ Enabled: false
10
+
11
+ Style/SymbolArray:
12
+ EnforcedStyle: brackets
13
+
14
+ Metrics/LineLength:
15
+ Max: 100
16
+
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - '*.gemspec'
20
+ - 'spec/**/*.rb'
21
+
22
+ Documentation:
23
+ Enabled: false
24
+
25
+ Metrics/MethodLength:
26
+ Max: 15
27
+
28
+ Metrics/AbcSize:
29
+ Max: 17
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,7 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2018-10-22 14:47:09 +0200 using RuboCop version 0.59.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
data/.rubosync.yml ADDED
@@ -0,0 +1,2 @@
1
+ git:
2
+ repo: git@github.com:phobos/shared.git
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/.travis.yml ADDED
@@ -0,0 +1,37 @@
1
+ sudo: required
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.1
5
+ - 2.4.4
6
+ - 2.3.7
7
+
8
+ services:
9
+ - docker
10
+
11
+ env:
12
+ global:
13
+ - DEFAULT_TIMEOUT=20
14
+ - CC_TEST_REPORTER_ID=a990fd40ff4421e8b28167232242a1d6c6638f9907fc0b80eb90f82f88fcfd81
15
+
16
+ before_install:
17
+ - env
18
+ - docker-compose --version
19
+ - docker --version
20
+ - docker-compose config
21
+ - docker-compose up -d --force-recreate kafka zookeeper
22
+ - docker-compose build test
23
+
24
+ before_script:
25
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
26
+ - chmod +x ./cc-test-reporter
27
+ - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter before-build || echo "Skipping CC coverage before-build"; fi
28
+ - mkdir coverage/
29
+ - touch ./coverage/.resultset.json
30
+
31
+ script:
32
+ - docker-compose run --rm test
33
+
34
+ after_script:
35
+ - cat ./coverage/.resultset.json | sed "s|/opt/phobos|$PWD|" > ./coverage/.newresultset.json
36
+ - cp ./coverage/.newresultset.json ./coverage/.resultset.json
37
+ - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT || echo "Skipping CC coverage after-build"; fi
data/CHANGELOG.md ADDED
@@ -0,0 +1,170 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+ ``
7
+ ## UNRELEASED
8
+
9
+ ## [2.1.0] - 2021-05-27
10
+
11
+ - Modify config to allow specifying kafka connection information separately for consumers and producers
12
+
13
+ ## [2.0.2] - 2021-01-28
14
+ - Additional fixes for Ruby 3.0
15
+
16
+ ## [2.0.1] - 2021-01-14
17
+ - Fix bug with Ruby 3.0 around OpenStruct
18
+
19
+ ## [2.0.0-beta1] - 2020-05-04
20
+
21
+ - Remove deprecated patterns:
22
+ -- `before_consume` method
23
+ -- `around_consume` as a class method or without yielding values
24
+ -- `publish` and `async_publish` with positional arguments
25
+
26
+ ## [1.9.0] - 2020-03-05
27
+ - Bumped version to 1.9.0.
28
+
29
+ ## [1.9.0-beta3] - 2020-02-05
30
+
31
+ - Fix bug where deprecation errors would be shown when receiving nil payloads
32
+ even if `around_consume` was updated to yield them.
33
+
34
+
35
+ ## [1.9.0-beta2] - 2020-01-09
36
+
37
+ - Allow `around_consume` to yield payload and metadata, and deprecate
38
+ `before_consume` and `around_consume` that does not yield anything.
39
+
40
+ ## [1.9.0-beta1] - 2019-12-18
41
+ - Update `publish` and `async_publish` to use keyword arguments
42
+ instead of positional ones. Deprecate positional arguments
43
+ in anticipation of removing them with 2.0.
44
+
45
+ ## [1.8.3-beta2] - 2019-11-15
46
+ - Add support for message headers in both produced and consumed
47
+ messages and batches.
48
+
49
+ ## [1.8.3-beta1] - 2019-11-11
50
+ - Automatically heartbeat after every message if necessary in batch
51
+ mode.
52
+
53
+ ## [1.8.2] - 2019-11-11
54
+ - Version bump for official release.
55
+
56
+ ## [1.8.2-beta2] - 2019-06-21
57
+ - Added the `persistent_connections` setting and the corresponding
58
+ `sync_producer_shutdown` method to enable reusing the connection
59
+ for regular (sync) producers.
60
+
61
+ ## [1.8.2-beta1] - 2019-03-13
62
+
63
+ - Added `BatchHandler` to consume messages in batches on the business
64
+ layer.
65
+
66
+ ## [1.8.1] - 2018-11-23
67
+ ### Added
68
+ - Added ability to send partition keys separate from messsage keys.
69
+
70
+ ## [1.8.0] - 2018-07-22
71
+ ### Added
72
+ - Possibility to configure a custom logger #81
73
+ ### Changed
74
+ - Reduce the volume of info-level log messages #78
75
+ - Phobos Handler `around_consume` is now an instance method #82
76
+ - Send consumer heartbeats between retry attempts #83
77
+
78
+ ## [1.7.2] - 2018-05-03
79
+ ### Added
80
+ - Add ability to override session_timeout, heartbeat_interval, offset_retention_time, offset_commit_interval, and offset_commit_threshold per listener
81
+ ### Changed
82
+ - Phobos CLI: Load boot file before configuring (instead of after)
83
+
84
+ ## [1.7.1] - 2018-02-22
85
+ ### Fixed
86
+ - Phobos overwrites ENV['RAILS_ENV'] with incorrect value #71
87
+ - Possible NoMethodError #force_encoding #63
88
+ - Phobos fails silently #66
89
+ ### Added
90
+ - Add offset_retention_time to consumer options #62
91
+
92
+ ## [1.7.0] - 2017-12-05
93
+ ### Fixed
94
+ - Test are failing with ruby-kafka 0.5.0 #48
95
+ - Allow Phobos to run in apps using ActiveSupport 3.x #57
96
+ ### Added
97
+ - Property (handler) added to listener instrumentation #60
98
+ ### Removed
99
+ - Property (time_elapsed) removed - use duration instead #24
100
+ ### Changed
101
+ - Max bytes per partition is now 1 MB by default #56
102
+
103
+ ## [1.6.1] - 2017-11-16
104
+ ### Fixed
105
+ - `Phobos::Test::Helper` is broken #53
106
+
107
+ ## [1.6.0] - 2017-11-16
108
+ ### Added
109
+ - Support for outputting logs as json #50
110
+ - Make configuration, especially of listeners, more flexible. #31
111
+ - Phobos Discord chat
112
+ - Support for consuming `each_message` instead of `each_batch` via the delivery listener option. #21
113
+ - Instantiate a single handler class instance and use that both for `consume` and `before_consume`. #47
114
+
115
+ ### Changed
116
+ - Pin ruby-kafka version to < 0.5.0 #48
117
+ - Update changelog to follow the [Keep a Changelog](http://keepachangelog.com/) structure
118
+
119
+ ## [1.5.0] - 2017-10-25
120
+ ### Added
121
+ - Add `before_consume` callback to support single point of decoding a message klarna/phobos_db_checkpoint#34
122
+ - Add `Phobos::Test::Helper` for testing, to test consumers with minimal setup required
123
+
124
+ ### Changed
125
+ - Allow configuration of backoff per listener #35
126
+ - Move container orchestration into docker-compose
127
+ - Update docker images #38
128
+
129
+ ### Fixed
130
+ - Make specs run locally #36
131
+
132
+ ## [1.4.2] - 2017-09-29
133
+ ### Fixed
134
+ - Async publishing always delivers messages #33
135
+
136
+ ## [1.4.1] - 2017-08-22
137
+ ### Added
138
+ - Update dev dependencies to fix warnings for the new unified Integer class
139
+
140
+ ### Fixed
141
+ - Include the error `Kafka::ProcessingError` into the abort block
142
+
143
+ ## [1.4.0] - 2017-08-21
144
+ ### Added
145
+ - Support for hash provided settings #30
146
+
147
+ ## [1.3.0] - 2017-06-15
148
+ ### Added
149
+ - Support for ERB syntax in Phobos config file #26
150
+
151
+ ## [1.2.1] - 2016-10-12
152
+ ### Fixed
153
+ - Ensure JSON layout for log files
154
+
155
+ ## [1.2.0] - 2016-10-10
156
+ ### Added
157
+ - Log file can be disabled #20
158
+ - Property (time_elapsed) available for notifications `listener.process_message` and `listener.process_batch` #24
159
+ - Option to configure ruby-kafka logger #23
160
+
161
+ ## [1.1.0] - 2016-09-02
162
+ ### Added
163
+ - Removed Hashie as a dependency #12
164
+ - Allow configuring consumers min_bytes & max_wait_time #15
165
+ - Allow configuring producers max_queue_size, delivery_threshold & delivery_interval #16
166
+ - Allow configuring force_encoding for message payload #18
167
+
168
+ ## [1.0.0] - 2016-08-08
169
+ ### Added
170
+ - Published on Github!
data/Dockerfile ADDED
@@ -0,0 +1,14 @@
1
+ FROM ruby:2.5.1-alpine
2
+
3
+ RUN apk update && apk upgrade && \
4
+ apk add --no-cache bash git openssh build-base
5
+ RUN gem install bundler -v 1.16.1
6
+
7
+ WORKDIR /opt/phobos
8
+
9
+ ADD Gemfile Gemfile
10
+ ADD phobos.gemspec phobos.gemspec
11
+ ADD lib/phobos/version.rb lib/phobos/version.rb
12
+ RUN bundle install
13
+
14
+ ADD . .
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in phobos.gemspec
6
+ gemspec
7
+
8
+ gem 'ruby-kafka', git: 'https://github.com/zendesk/ruby-kafka', branch: 'master'
data/LICENSE.txt ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS