zk 1.9.3 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/build.yml +55 -0
  3. data/.gitignore +1 -0
  4. data/Gemfile +18 -8
  5. data/README.markdown +9 -9
  6. data/RELEASES.markdown +28 -1
  7. data/lib/zk/client/base.rb +15 -0
  8. data/lib/zk/client/threaded.rb +3 -3
  9. data/lib/zk/client.rb +1 -1
  10. data/lib/zk/election.rb +1 -1
  11. data/lib/zk/event_handler.rb +16 -8
  12. data/lib/zk/event_handler_subscription/base.rb +1 -1
  13. data/lib/zk/fork_hook.rb +9 -4
  14. data/lib/zk/locker/locker_base.rb +14 -2
  15. data/lib/zk/locker/semaphore.rb +1 -3
  16. data/lib/zk/logger.rb +34 -0
  17. data/lib/zk/node_deletion_watcher.rb +4 -5
  18. data/lib/zk/pool.rb +12 -12
  19. data/lib/zk/subscription.rb +1 -1
  20. data/lib/zk/threaded_callback.rb +1 -1
  21. data/lib/zk/threadpool.rb +1 -1
  22. data/lib/zk/version.rb +1 -1
  23. data/lib/zk.rb +1 -5
  24. data/spec/event_catcher_spec.rb +1 -1
  25. data/spec/logging_progress_bar_formatter.rb +1 -1
  26. data/spec/message_queue_spec.rb +6 -6
  27. data/spec/shared/client_examples.rb +81 -81
  28. data/spec/shared/locker_examples.rb +13 -13
  29. data/spec/spec_helper.rb +12 -13
  30. data/spec/support/bogus_mongoid.rb +1 -1
  31. data/spec/support/client_forker.rb +1 -1
  32. data/spec/support/event_catcher.rb +1 -1
  33. data/spec/support/logging.rb +15 -47
  34. data/spec/zk/00_forked_client_integration_spec.rb +3 -3
  35. data/spec/zk/client/locking_and_session_death_spec.rb +2 -2
  36. data/spec/zk/client_spec.rb +19 -19
  37. data/spec/zk/election_spec.rb +44 -44
  38. data/spec/zk/extensions_spec.rb +2 -2
  39. data/spec/zk/locker/exclusive_locker_spec.rb +41 -41
  40. data/spec/zk/locker/locker_basic_spec.rb +55 -33
  41. data/spec/zk/locker/semaphore_spec.rb +39 -32
  42. data/spec/zk/locker/shared_exclusive_integration_spec.rb +37 -37
  43. data/spec/zk/locker/shared_locker_spec.rb +43 -43
  44. data/spec/zk/locker_spec.rb +2 -2
  45. data/spec/zk/module_spec.rb +25 -25
  46. data/spec/zk/mongoid_spec.rb +47 -47
  47. data/spec/zk/node_deletion_watcher_spec.rb +39 -31
  48. data/spec/zk/pool_spec.rb +56 -65
  49. data/spec/zk/threaded_callback_spec.rb +10 -10
  50. data/spec/zk/threadpool_spec.rb +25 -25
  51. data/spec/zk/watch_spec.rb +67 -79
  52. data/spec/zk/zookeeper_spec.rb +36 -30
  53. data/zk.gemspec +1 -2
  54. metadata +26 -47
  55. data/.travis.yml +0 -25
  56. data/lib/zk/logging.rb +0 -36
data/.travis.yml DELETED
@@ -1,25 +0,0 @@
1
- ---
2
- notifications:
3
- email:
4
- - slyphon@gmail.com
5
- - eric@5stops.com
6
-
7
- env:
8
- - SPAWN_ZOOKEEPER='true'
9
-
10
- # pull in releaseops submodule
11
- before_install:
12
- - git submodule update --init --recursive
13
-
14
- rvm:
15
- - 1.9.3
16
- - 1.9.2
17
- - 1.8.7
18
- - ree
19
-
20
- # jruby specs are too intesive for travis
21
- # - jruby-18mode
22
- # - jruby-19mode
23
-
24
- bundler_args: --without development docs coverage
25
-
data/lib/zk/logging.rb DELETED
@@ -1,36 +0,0 @@
1
- module ZK
2
- # use the ZK.logger if non-nil (to allow users to override the logger)
3
- # otherwise, use a Loggging logger based on the class name
4
- module Logging
5
- extend ZK::Concern
6
-
7
- included do
8
- def self.logger
9
- ::ZK.logger || ::Logging.logger[logger_name]
10
- end
11
- end
12
-
13
- def self.set_default
14
- ::Logging.logger['ZK'].tap do |ch_root|
15
- ::Logging.appenders.stderr.tap do |serr|
16
- serr.layout = ::Logging.layouts.pattern(
17
- :pattern => '%.1l, [%d #p] %c30.30{2}: %m\n',
18
- :date_pattern => '%Y-%m-%d %H:%M:%S.%6N'
19
- )
20
-
21
- serr.auto_flushing = 25
22
- serr.flush_period = 5
23
-
24
- ch_root.add_appenders(serr)
25
- end
26
-
27
- ch_root.level = ENV['ZK_DEBUG'] ? :debug : :off
28
- end
29
- end
30
-
31
- def logger
32
- self.class.logger
33
- end
34
- end
35
- end
36
-