mneme 0.5.0 → 0.5.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.
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in mneme.gemspec
4
4
  gemspec
5
5
 
6
- gem 'redis', :git => 'git://github.com/igrigorik/redis-rb.git'
6
+ gem 'redis', :git => 'git://github.com/ezmobius/redis-rb.git'
@@ -5,8 +5,8 @@ require 'redis'
5
5
  require 'redis/connection/synchrony'
6
6
  require 'bloomfilter-rb'
7
7
 
8
- require 'lib/mneme/helper'
9
- require 'lib/mneme/sweeper'
8
+ require 'mneme/helper'
9
+ require 'mneme/sweeper'
10
10
 
11
11
  class Mneme < Goliath::API
12
12
  include Mnemosyne::Helper
@@ -16,17 +16,19 @@ module Mnemosyne
16
16
  end
17
17
 
18
18
  sweeper = Proc.new do
19
- current = epoch_name(@config['namespace'], 0, @config['length'])
20
- @logger.info "Sweeping old filters, current epoch: #{current}"
19
+ Fiber.new do
20
+ current = epoch_name(@config['namespace'], 0, @config['length'])
21
+ @logger.info "Sweeping old filters, current epoch: #{current}"
21
22
 
22
- conn = Redis.new
23
- @config['periods'].times do |n|
24
- name = epoch_name(@config['namespace'], n + @config['periods'], @config['length'])
23
+ conn = Redis.new
24
+ @config['periods'].times do |n|
25
+ name = epoch_name(@config['namespace'], n + @config['periods'], @config['length'])
25
26
 
26
- conn.del(name)
27
- @logger.info "Removed: #{name}"
28
- end
29
- conn.client.disconnect
27
+ conn.del(name)
28
+ @logger.info "Removed: #{name}"
29
+ end
30
+ conn.client.disconnect
31
+ end.resume
30
32
  end
31
33
 
32
34
  sweeper.call
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mneme"
6
- s.version = "0.5.0"
6
+ s.version = "0.5.1"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Ilya Grigorik"]
9
9
  s.email = ["ilya@igvita.com"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mneme
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.0
5
+ version: 0.5.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ilya Grigorik
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-24 00:00:00 -04:00
13
+ date: 2011-03-29 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency