toiler 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5b3fa5e5c309c7e6b3f80c883c9834850b0fe97
4
- data.tar.gz: e9db1cf4e3d1226a8e200bfabd24b52f7664ab15
3
+ metadata.gz: 5abd63f186c193943169cb25c4f29498dcf0b7cb
4
+ data.tar.gz: 1d781bbfb99012e0f3af32ad8caac69fb00e5c10
5
5
  SHA512:
6
- metadata.gz: db9a13283091cd3057044a84194c418a3249b1c4854879f15ccbc06e5f2e975a9a24bd8a83c1b02122797cc9c394b60c40065a9964fc2aef31ef918d407c1485
7
- data.tar.gz: cb0751b3a4e0cd902828833110bfd8132e4d147308e13db10b95cd3cc11970efb3afd3121cc119929d3dfe8df370f22f3dedc45559ed32da8ad7759490fdcc07
6
+ metadata.gz: f1c7cacc2c8ba06c9863d056550a36b6429a2c3422e394b14284e0bd63d06d85fbad6976a485c9e3cdde06ef86310a8aba6a5eb3145b99a1197db56eaa06417b
7
+ data.tar.gz: a1e41500cebe89ef547e86a23f7e647e04dd8704f8808f1ccf8197bf7ccb2423d21172052e60259bcbc0bf980fdef8ba474ba2fb3f5aa2e0520ddd31b77acd05
data/Gemfile CHANGED
@@ -1,12 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'concurrent-ruby', '~> 1.0.0'
4
- gem 'concurrent-ruby-edge', '~> 0.2.0'
5
- gem 'aws-sdk', '~> 2.2'
3
+ gemspec
6
4
 
7
5
  group :development do
8
6
  gem 'rubocop'
9
7
  end
10
- group :test do
11
- gem 'rspec'
12
- end
data/Gemfile.lock CHANGED
@@ -1,56 +1,69 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ toiler (0.4.3)
5
+ aws-sdk-sqs (~> 1.0, >= 1.0.0)
6
+ concurrent-ruby (~> 1.0, >= 1.0.0)
7
+ concurrent-ruby-edge (~> 0.3, >= 0.3)
8
+
1
9
  GEM
2
10
  remote: https://rubygems.org/
3
11
  specs:
4
- ast (2.2.0)
5
- aws-sdk (2.3.7)
6
- aws-sdk-resources (= 2.3.7)
7
- aws-sdk-core (2.3.7)
12
+ ast (2.4.0)
13
+ aws-eventstream (1.0.1)
14
+ aws-partitions (1.100.0)
15
+ aws-sdk-core (3.24.1)
16
+ aws-eventstream (~> 1.0)
17
+ aws-partitions (~> 1.0)
18
+ aws-sigv4 (~> 1.0)
8
19
  jmespath (~> 1.0)
9
- aws-sdk-resources (2.3.7)
10
- aws-sdk-core (= 2.3.7)
11
- concurrent-ruby (1.0.2)
12
- concurrent-ruby-edge (0.2.2)
13
- concurrent-ruby (~> 1.0.2)
14
- diff-lcs (1.2.5)
15
- jmespath (1.2.4)
16
- json_pure (>= 1.8.1)
17
- json_pure (1.8.3)
18
- parser (2.3.1.0)
19
- ast (~> 2.2)
20
- powerpack (0.1.1)
21
- rainbow (2.1.0)
22
- rspec (3.5.0)
23
- rspec-core (~> 3.5.0)
24
- rspec-expectations (~> 3.5.0)
25
- rspec-mocks (~> 3.5.0)
26
- rspec-core (3.5.2)
27
- rspec-support (~> 3.5.0)
28
- rspec-expectations (3.5.0)
20
+ aws-sdk-sqs (1.4.0)
21
+ aws-sdk-core (~> 3)
22
+ aws-sigv4 (~> 1.0)
23
+ aws-sigv4 (1.0.3)
24
+ concurrent-ruby (1.0.5)
25
+ concurrent-ruby-edge (0.3.1)
26
+ concurrent-ruby (= 1.0.5)
27
+ diff-lcs (1.3)
28
+ jaro_winkler (1.5.1)
29
+ jmespath (1.4.0)
30
+ parallel (1.12.1)
31
+ parser (2.5.1.2)
32
+ ast (~> 2.4.0)
33
+ powerpack (0.1.2)
34
+ rainbow (3.0.0)
35
+ rspec (3.8.0)
36
+ rspec-core (~> 3.8.0)
37
+ rspec-expectations (~> 3.8.0)
38
+ rspec-mocks (~> 3.8.0)
39
+ rspec-core (3.8.0)
40
+ rspec-support (~> 3.8.0)
41
+ rspec-expectations (3.8.1)
29
42
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.5.0)
31
- rspec-mocks (3.5.0)
43
+ rspec-support (~> 3.8.0)
44
+ rspec-mocks (3.8.0)
32
45
  diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.5.0)
34
- rspec-support (3.5.0)
35
- rubocop (0.40.0)
36
- parser (>= 2.3.1.0, < 3.0)
46
+ rspec-support (~> 3.8.0)
47
+ rspec-support (3.8.0)
48
+ rubocop (0.58.2)
49
+ jaro_winkler (~> 1.5.1)
50
+ parallel (~> 1.10)
51
+ parser (>= 2.5, != 2.5.1.1)
37
52
  powerpack (~> 0.1)
38
- rainbow (>= 1.99.1, < 3.0)
53
+ rainbow (>= 2.2.2, < 4.0)
39
54
  ruby-progressbar (~> 1.7)
40
55
  unicode-display_width (~> 1.0, >= 1.0.1)
41
- ruby-progressbar (1.8.1)
42
- unicode-display_width (1.0.5)
56
+ ruby-progressbar (1.10.0)
57
+ unicode-display_width (1.4.0)
43
58
 
44
59
  PLATFORMS
45
60
  ruby
46
61
  x64-mingw32
47
62
 
48
63
  DEPENDENCIES
49
- aws-sdk (~> 2.2)
50
- concurrent-ruby (~> 1.0.0)
51
- concurrent-ruby-edge (~> 0.2.0)
52
64
  rspec
53
65
  rubocop
66
+ toiler!
54
67
 
55
68
  BUNDLED WITH
56
- 1.11.2
69
+ 1.16.3
data/LICENSE CHANGED
@@ -1,6 +1,165 @@
1
- Copyright (c) Sebastian Schepens
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
2
3
 
3
- Toiler is an Open Source project licensed under the terms of
4
- the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
5
- for license text.
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
6
7
 
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
data/README.md CHANGED
@@ -1,29 +1,36 @@
1
- ##Toiler
1
+ ## Toiler
2
+
2
3
  Toiler is a AWS SQS long-polling thread-based message processor.
3
4
  It's based on [shoryuken](https://github.com/phstc/shoryuken) but takes
4
5
  a different approach at loadbalancing and uses long-polling.
5
6
 
6
- ##Features
7
- ###Concurrency
7
+ ## Features
8
+
9
+ ### Concurrency
10
+
8
11
  Toiler allows to specify the amount of processors (threads) that should be spawned for each queue.
9
12
  Instead of [shoryuken's](https://github.com/phstc/shoryuken) loadbalancing approach, Toiler delegates this work to the kernel scheduling threads.
10
13
 
11
- ###Long-Polling
14
+ ### Long-Polling
15
+
12
16
  A Fetcher thread is spawned for each queue.
13
17
  Fetchers are resposible for polling SQS and retreiving messages.
14
18
  They are optimised to not bring more messages than the amount of processors avaiable for such queue.
15
19
  By long-polling fetchers wait for a configurable amount of time for messages to become available on a single request, this prevents unneccesarilly requesting messages when there are none.
16
20
 
17
- ###Message Parsing
21
+ ### Message Parsing
22
+
18
23
  Workers can configure a parser Class or Proc to parse an SQS message body before being processed.
19
24
 
20
- ###Batches
25
+ ### Batches
26
+
21
27
  Toiler allows a Worker to be able to receive a batch of messages instead of a single one.
22
28
 
23
- ###Auto Visibility Extension
29
+ ### Auto Visibility Extension
30
+
24
31
  Toiler has the ability to automatically extend the visibility timeout of and SQS message to prevent the message from re-entering the queue if processing of such message is taking longer than the queue's visibility timeout.
25
32
 
26
- ##Instalation
33
+ ## Instalation
27
34
 
28
35
  Add this line to your application's Gemfile:
29
36
 
@@ -112,8 +119,8 @@ toiler --help
112
119
 
113
120
 
114
121
  ## Credits
115
-
116
- Much of the credit goes to [Pablo Cantero](https://github.com/phstc), creator of [Shoryuken](https://github.com/phstc/shoryuken), and [everybody who contributed to it](https://github.com/phstc/shoryuken/graphs/contributors).
122
+ [Sebastian Schepens](https://github.com/sschepens) for the creation of the proyect.
123
+ But much of the credit goes to [Pablo Cantero](https://github.com/phstc), creator of [Shoryuken](https://github.com/phstc/shoryuken), and [everybody who contributed to it](https://github.com/phstc/shoryuken/graphs/contributors).
117
124
 
118
125
  ## Contributing
119
126
 
data/lib/toiler.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'aws-sdk'
1
+ require 'aws-sdk-sqs'
2
2
  require 'toiler/utils/environment_loader'
3
3
  require 'toiler/utils/logging'
4
4
  require 'toiler/utils/argument_parser'
@@ -72,7 +72,7 @@ module Toiler
72
72
  end
73
73
 
74
74
  def poll_future
75
- Concurrent.future do
75
+ Concurrent::Promises.future do
76
76
  queue.receive_messages message_attribute_names: %w(All),
77
77
  wait_time_seconds: wait,
78
78
  max_number_of_messages: max_messages
@@ -81,10 +81,15 @@ module Toiler
81
81
 
82
82
  def poll_messages
83
83
  return unless polling.make_true
84
- poll_future.on_completion! do |success, msgs, error|
84
+ poll_future.on_rejection! do
85
85
  polling.make_false
86
86
  scheduled.make_false
87
- if success && !msgs.nil? && !msgs.empty?
87
+ tell :schedule_poll
88
+ end
89
+ poll_future.on_fulfillment! do |msgs|
90
+ polling.make_false
91
+ scheduled.make_false
92
+ if !msgs.nil? && !msgs.empty?
88
93
  tell [:assign_messages, msgs]
89
94
  else
90
95
  tell :schedule_poll
@@ -1,4 +1,4 @@
1
1
  # Toiler Version
2
2
  module Toiler
3
- VERSION = '0.4.3'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
data/toiler.gemspec CHANGED
@@ -17,14 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_development_dependency 'bundler', '~> 1.6'
21
- spec.add_development_dependency 'rake'
22
20
  spec.add_development_dependency 'rspec'
23
- spec.add_development_dependency 'pry-byebug'
24
- spec.add_development_dependency 'nokogiri'
25
- spec.add_development_dependency 'dotenv'
26
21
 
27
- spec.add_dependency 'aws-sdk', '~> 2.2', '>= 2.2.10'
22
+ spec.add_dependency 'aws-sdk-sqs', '~> 1.0', '>= 1.0.0'
28
23
  spec.add_dependency 'concurrent-ruby', '~> 1.0', '>= 1.0.0'
29
- spec.add_dependency 'concurrent-ruby-edge', '~> 0.2.0', '>= 0.2.0'
24
+ spec.add_dependency 'concurrent-ruby-edge', '~> 0.3', '>= 0.3'
30
25
  end
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Schepens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-06 00:00:00.000000000 Z
11
+ date: 2018-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.6'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.6'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: rspec
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -53,67 +25,25 @@ dependencies:
53
25
  - !ruby/object:Gem::Version
54
26
  version: '0'
55
27
  - !ruby/object:Gem::Dependency
56
- name: pry-byebug
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: nokogiri
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: dotenv
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: aws-sdk
28
+ name: aws-sdk-sqs
99
29
  requirement: !ruby/object:Gem::Requirement
100
30
  requirements:
101
31
  - - "~>"
102
32
  - !ruby/object:Gem::Version
103
- version: '2.2'
33
+ version: '1.0'
104
34
  - - ">="
105
35
  - !ruby/object:Gem::Version
106
- version: 2.2.10
36
+ version: 1.0.0
107
37
  type: :runtime
108
38
  prerelease: false
109
39
  version_requirements: !ruby/object:Gem::Requirement
110
40
  requirements:
111
41
  - - "~>"
112
42
  - !ruby/object:Gem::Version
113
- version: '2.2'
43
+ version: '1.0'
114
44
  - - ">="
115
45
  - !ruby/object:Gem::Version
116
- version: 2.2.10
46
+ version: 1.0.0
117
47
  - !ruby/object:Gem::Dependency
118
48
  name: concurrent-ruby
119
49
  requirement: !ruby/object:Gem::Requirement
@@ -140,20 +70,20 @@ dependencies:
140
70
  requirements:
141
71
  - - "~>"
142
72
  - !ruby/object:Gem::Version
143
- version: 0.2.0
73
+ version: '0.3'
144
74
  - - ">="
145
75
  - !ruby/object:Gem::Version
146
- version: 0.2.0
76
+ version: '0.3'
147
77
  type: :runtime
148
78
  prerelease: false
149
79
  version_requirements: !ruby/object:Gem::Requirement
150
80
  requirements:
151
81
  - - "~>"
152
82
  - !ruby/object:Gem::Version
153
- version: 0.2.0
83
+ version: '0.3'
154
84
  - - ">="
155
85
  - !ruby/object:Gem::Version
156
- version: 0.2.0
86
+ version: '0.3'
157
87
  description: Toiler is a super efficient AWS SQS thread based message processor
158
88
  email:
159
89
  - sebas.schep@hotmail.com
@@ -211,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
141
  version: '0'
212
142
  requirements: []
213
143
  rubyforge_project:
214
- rubygems_version: 2.5.1
144
+ rubygems_version: 2.6.11
215
145
  signing_key:
216
146
  specification_version: 4
217
147
  summary: Toiler is a super efficient AWS SQS thread based message processor