graphql-anycable 0.4.2 → 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
  SHA256:
3
- metadata.gz: 0f464f4d333c2d59173af97549967def49f8843ae53882c4ab455fa48e1b62ab
4
- data.tar.gz: f19ba6bfd926d4038ce6c11bc40c499f60f5d426daeec59f9b2f28304d08d0bb
3
+ metadata.gz: 6c831aba1f67077cccb4ef5f1b7858715cf056e554551dab59acdf265a8c671e
4
+ data.tar.gz: 5049b208e8a02a2e110e698f5336a1314577d2e1f8a37742ce07807daac6e41a
5
5
  SHA512:
6
- metadata.gz: 7b35ce8815a7ffebed1162b35d21cf3addb5f6677df3dd00311827cdac7d371277703c271447631a143d9b6e3e4865ea17a141ce2664ea7948fe9c52ac6bc6f5
7
- data.tar.gz: 7696f55e6a71cc8e1c14d08473a86da9b950317d88224afb8beaa2f0484d96886bf1d0d5a51cc53d3026a8598f4f4f7ecc57db9106b4aec80bcd81a0670b07e1
6
+ metadata.gz: d9451177ced38d8f963fe8b7f4c5b8ae1933a1d9730403202ee0864f23b3649752e538f8e480aedcae042aac2958b60145dc1305b79e67a3e480a96279df2bb1
7
+ data.tar.gz: 1367ac8df59b0470725197da7be2701175cb8571146f81eaa896dd00b3052eee1f91e2abdabdf67bb5a18754385e11169d942864a65e1fb59cdb7f8afdd5938e
data/README.md CHANGED
@@ -50,7 +50,7 @@ Or install it yourself as:
50
50
 
51
51
  ```ruby
52
52
  class MySchema < GraphQL::Schema
53
- use GraphQL::Subscriptions::AnyCableSubscriptions
53
+ use GraphQL::AnyCable
54
54
 
55
55
  subscription SubscriptionType
56
56
  end
@@ -111,7 +111,7 @@ To avoid filling Redis storage with stale subscription data:
111
111
 
112
112
  ## Configuration
113
113
 
114
- GraphQL-Anycable uses [anyway_config] to configure itself. There are several possibilities to configure this gem:
114
+ GraphQL-AnyCable uses [anyway_config] to configure itself. There are several possibilities to configure this gem:
115
115
 
116
116
  1. Environment variables:
117
117
 
@@ -132,7 +132,7 @@ GraphQL-Anycable uses [anyway_config] to configure itself. There are several pos
132
132
  3. Configuration from your application code:
133
133
 
134
134
  ```ruby
135
- GraphQL::Anycable.configure do |config|
135
+ GraphQL::AnyCable.configure do |config|
136
136
  config.subscription_expiration_seconds = 3600 # 1 hour
137
137
  end
138
138
  ```
@@ -6,7 +6,7 @@ require "graphql/anycable/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "graphql-anycable"
9
- spec.version = GraphQL::Anycable::VERSION
9
+ spec.version = GraphQL::AnyCable::VERSION
10
10
  spec.authors = ["Andrey Novikov"]
11
11
  spec.email = ["envek@envek.name"]
12
12
 
@@ -9,7 +9,11 @@ require_relative "graphql/anycable/railtie" if defined?(Rails)
9
9
  require_relative "graphql/subscriptions/anycable_subscriptions"
10
10
 
11
11
  module GraphQL
12
- module Anycable
12
+ module AnyCable
13
+ def self.use(schema)
14
+ schema.use GraphQL::Subscriptions::AnyCableSubscriptions
15
+ end
16
+
13
17
  module_function
14
18
 
15
19
  def redis
@@ -24,7 +28,7 @@ module GraphQL
24
28
  end
25
29
 
26
30
  def config
27
- @config ||= GraphQL::Anycable::Config.new
31
+ @config ||= GraphQL::AnyCable::Config.new
28
32
  end
29
33
 
30
34
  def configure
@@ -32,3 +36,6 @@ module GraphQL
32
36
  end
33
37
  end
34
38
  end
39
+
40
+ # For backward compatibility
41
+ GraphQL::Anycable = GraphQL::AnyCable
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphQL
4
- module Anycable
4
+ module AnyCable
5
5
  module Cleaner
6
6
  extend self
7
7
 
@@ -55,11 +55,11 @@ module GraphQL
55
55
  end
56
56
 
57
57
  def redis
58
- GraphQL::Anycable.redis
58
+ GraphQL::AnyCable.redis
59
59
  end
60
60
 
61
61
  def config
62
- GraphQL::Anycable.config
62
+ GraphQL::AnyCable.config
63
63
  end
64
64
  end
65
65
  end
@@ -3,7 +3,7 @@
3
3
  require "anyway"
4
4
 
5
5
  module GraphQL
6
- module Anycable
6
+ module AnyCable
7
7
  class Config < Anyway::Config
8
8
  config_name :graphql_anycable
9
9
  env_prefix :graphql_anycable
@@ -3,7 +3,7 @@
3
3
  require "rails"
4
4
 
5
5
  module GraphQL
6
- module Anycable
6
+ module AnyCable
7
7
  class Railtie < ::Rails::Railtie
8
8
  rake_tasks do
9
9
  path = File.expand_path(__dir__)
@@ -13,17 +13,17 @@ namespace :graphql do
13
13
  namespace :clean do
14
14
  # Clean up old channels
15
15
  task :channels do
16
- GraphQL::Anycable::Cleaner.clean_channels
16
+ GraphQL::AnyCable::Cleaner.clean_channels
17
17
  end
18
18
 
19
19
  # Clean up old subscriptions (they should have expired by themselves)
20
20
  task :subscriptions do
21
- GraphQL::Anycable::Cleaner.clean_subscriptions
21
+ GraphQL::AnyCable::Cleaner.clean_subscriptions
22
22
  end
23
23
 
24
24
  # Clean up subscription_ids from events for expired subscriptions
25
25
  task :events do
26
- GraphQL::Anycable::Cleaner.clean_events
26
+ GraphQL::AnyCable::Cleaner.clean_events
27
27
  end
28
28
  end
29
29
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphQL
4
- module Anycable
5
- VERSION = "0.4.2"
4
+ module AnyCable
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
@@ -54,7 +54,7 @@ module GraphQL
54
54
  class AnyCableSubscriptions < GraphQL::Subscriptions
55
55
  extend Forwardable
56
56
 
57
- def_delegators :"GraphQL::Anycable", :redis, :config
57
+ def_delegators :"GraphQL::AnyCable", :redis, :config
58
58
 
59
59
  SUBSCRIPTION_PREFIX = "graphql-subscription:"
60
60
  SUBSCRIPTION_EVENTS_PREFIX = "graphql-subscription-events:"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-anycable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov