gcpc 0.0.4 → 0.0.5

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: d26d83b3ad1b3c23b83aa62eb8742e522eaa14df00d608e33b639848354081db
4
- data.tar.gz: 74366ee318ca77cb08baaaf0d99c3021f72e30b744cc38cd66d6fb0bc33dc6b6
3
+ metadata.gz: b617d83445ce50725dbf992702e226b89f255f0760d969732e42c782b6af05e4
4
+ data.tar.gz: 6fd34095e7bee0b101d04daa6d6824dcd1977ff97e804463f86837d6ef8a4b67
5
5
  SHA512:
6
- metadata.gz: f2c90798e86df808662e2906e2ab5b073b102a7aacfb77803dd63f37b72fb559822e0b1b91d9afdd2f929fa6b02ed6f6714df7ca67fa17a74fd3491a2dd5840d
7
- data.tar.gz: 4f659b9666d194f9317ab16cee630ba1698168557af6c9ea6bc15fa34e9ee399c3f31ae50fa6ace1db2511cb4192d487e7412ba37043aed590cd75cedd705f5a
6
+ metadata.gz: 6e17d2db5ed5dc4818f7d4995024f5e9c16b42ceb9fbd6d4cb09008d929dedf3dce6937dab2105f0913731e34554be1cdc524b8b8cc8990b22d9829aebeb1d41
7
+ data.tar.gz: 4565614b54983a4b15bb16eff6570c526a29ca053c5d15459e5031602ab07b060cdb607a538e4246f0c6c615cc1eb28a15545a1cceaa02d6447e849470832d14
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gcpc (0.0.4)
4
+ gcpc (0.0.5)
5
5
  google-cloud-pubsub
6
6
 
7
7
  GEM
@@ -16,21 +16,21 @@ GEM
16
16
  multipart-post (>= 1.2, < 3)
17
17
  google-cloud-core (1.3.0)
18
18
  google-cloud-env (~> 1.0)
19
- google-cloud-env (1.1.0)
19
+ google-cloud-env (1.2.0)
20
20
  faraday (~> 0.11)
21
- google-cloud-pubsub (0.36.0)
22
- concurrent-ruby (~> 1.0)
21
+ google-cloud-pubsub (0.38.0)
22
+ concurrent-ruby (~> 1.1)
23
23
  google-cloud-core (~> 1.2)
24
- google-gax (~> 1.3)
24
+ google-gax (~> 1.7)
25
25
  googleapis-common-protos (>= 1.3.9, < 2.0)
26
26
  grpc-google-iam-v1 (~> 0.6.9)
27
- google-gax (1.6.3)
27
+ google-gax (1.7.0)
28
28
  google-protobuf (~> 3.2)
29
29
  googleapis-common-protos (>= 1.3.5, < 2.0)
30
30
  googleauth (>= 0.6.2, < 0.10.0)
31
31
  grpc (>= 1.7.2, < 2.0)
32
32
  rly (~> 0.2.3)
33
- google-protobuf (3.8.0)
33
+ google-protobuf (3.9.0)
34
34
  googleapis-common-protos (1.3.9)
35
35
  google-protobuf (~> 3.0)
36
36
  googleapis-common-protos-types (~> 1.0)
@@ -44,8 +44,8 @@ GEM
44
44
  multi_json (~> 1.11)
45
45
  os (>= 0.9, < 2.0)
46
46
  signet (~> 0.7)
47
- grpc (1.21.0)
48
- google-protobuf (~> 3.7)
47
+ grpc (1.22.0)
48
+ google-protobuf (~> 3.8)
49
49
  googleapis-common-protos-types (~> 1.0)
50
50
  grpc-google-iam-v1 (0.6.9)
51
51
  googleapis-common-protos (>= 1.3.1, < 2.0)
@@ -59,7 +59,7 @@ GEM
59
59
  pry (0.12.2)
60
60
  coderay (~> 1.1.0)
61
61
  method_source (~> 0.9.0)
62
- public_suffix (3.1.0)
62
+ public_suffix (3.1.1)
63
63
  rake (10.5.0)
64
64
  rly (0.2.3)
65
65
  rspec (3.8.0)
@@ -37,6 +37,6 @@ module Gcpc
37
37
 
38
38
  extend Forwardable
39
39
 
40
- def_delegators :@engine, :publish
40
+ def_delegators :@engine, :publish, :publish_async, :topic
41
41
  end
42
42
  end
@@ -8,6 +8,8 @@ module Gcpc
8
8
  @interceptors = interceptors.map { |i| (i.class == Class) ? i.new : i }
9
9
  end
10
10
 
11
+ attr_reader :topic
12
+
11
13
  # @param [String] data
12
14
  # @param [Hash] attributes
13
15
  def publish(data, attributes = {})
@@ -15,7 +17,16 @@ module Gcpc
15
17
  a = attributes.dup
16
18
 
17
19
  intercept!(@interceptors, d, a) do |dd, aa|
18
- publish_message(dd, aa)
20
+ do_publish(dd, aa)
21
+ end
22
+ end
23
+
24
+ def publish_async(data, attributes = {}, &block)
25
+ d = data.dup
26
+ a = attributes.dup
27
+
28
+ intercept!(@interceptors, d, a) do |dd, aa|
29
+ do_publish_async(dd, aa, &block)
19
30
  end
20
31
  end
21
32
 
@@ -40,9 +51,16 @@ module Gcpc
40
51
 
41
52
  # @param [String] data
42
53
  # @param [Hash] attributes
43
- def publish_message(data, attributes)
54
+ def do_publish(data, attributes)
44
55
  @topic.publish(data, attributes)
45
56
  end
57
+
58
+ # @param [String] data
59
+ # @param [Hash] attributes
60
+ # @param [Proc] block
61
+ def do_publish_async(data, attributes, &block)
62
+ @topic.publish_async(data, attributes, &block)
63
+ end
46
64
  end
47
65
  end
48
66
  end
@@ -1,3 +1,3 @@
1
1
  module Gcpc
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gcpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nao Minami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-07 00:00:00.000000000 Z
11
+ date: 2019-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler