inbox-sync 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/inbox-sync/config.rb +1 -1
- data/lib/inbox-sync/sync.rb +3 -3
- data/lib/inbox-sync/version.rb +1 -1
- data/test/config_test.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -95,9 +95,9 @@ The (optional) folder on the source to create and archive (move) source inbox me
|
|
95
95
|
|
96
96
|
A logger to use. Defaults to ruby's `Logger` on `STDOUT`.
|
97
97
|
|
98
|
-
### `
|
98
|
+
### `num_workers`
|
99
99
|
|
100
|
-
This is the number of threads to sync mail items with. Each time a sync is run, the number of mail items that need to sync'd will be broken into `
|
100
|
+
This is the number of worker threads to sync mail items with. Each time a sync is run, the number of mail items that need to sync'd will be broken into `num_workers` groups and each group will sync its mail items in its own thread. The default is `1` which means only 1 worker thread will be spawned and each message will be sync'd sequentially.
|
101
101
|
|
102
102
|
## Running
|
103
103
|
|
data/lib/inbox-sync/config.rb
CHANGED
@@ -16,7 +16,7 @@ module InboxSync
|
|
16
16
|
opt :archive_folder, :default => 'Archived'
|
17
17
|
opt :logger, Logger, :required => true, :default => STDOUT
|
18
18
|
opt :filters, :default => [], :required => true
|
19
|
-
opt :
|
19
|
+
opt :num_workers, :default => 1, :required => true
|
20
20
|
|
21
21
|
def filter(*args, &block)
|
22
22
|
filters << Filter.new(*args, &block)
|
data/lib/inbox-sync/sync.rb
CHANGED
@@ -54,12 +54,12 @@ module InboxSync
|
|
54
54
|
logger.info "=== #{config_log_detail(@config.source)} sync finished. ==="
|
55
55
|
end
|
56
56
|
|
57
|
-
# this splits the mail_items list into `@config.
|
58
|
-
# this spreads
|
57
|
+
# this splits the mail_items list into `@config.num_workers` lists
|
58
|
+
# this spreads mail evenly across the groups with earlier items
|
59
59
|
# appearing earliest in each list
|
60
60
|
|
61
61
|
def mail_item_groups
|
62
|
-
num_groups = @config.
|
62
|
+
num_groups = @config.num_workers
|
63
63
|
groups = []
|
64
64
|
num_groups.times { groups << MailItemGroup.new(self) }
|
65
65
|
get_mail_items.each_with_index do |item, i|
|
data/lib/inbox-sync/version.rb
CHANGED
data/test/config_test.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inbox-sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-06-
|
18
|
+
date: 2012-06-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :development
|