forked from stripe-archive/mongoriver
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support breaking out of stream in persistent tailer (stripe-archive#18)
- Loading branch information
1 parent
ae548a5
commit cc8bee6
Showing
6 changed files
with
70 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Mongoriver | ||
VERSION = "0.4.4" | ||
VERSION = "0.4.5" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'mongo' | ||
|
||
class CursorStub | ||
def initialize | ||
@events = [] | ||
@index = 0 | ||
end | ||
|
||
def add_option(opt) end | ||
|
||
def generate_ops(max) | ||
@index = 0 | ||
(1..max).map do |id| | ||
@events << { | ||
'ts' => BSON::Timestamp.new(Time.now.to_i, 0), | ||
'ns' => 'foo.bar', | ||
'op' => 'i', | ||
'o' => { | ||
'_id' => id.to_s | ||
} | ||
} | ||
end | ||
end | ||
|
||
def has_next? | ||
@index < @events.length | ||
end | ||
|
||
def next | ||
@index += 1 | ||
@events[@index - 1] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters