statelydb 0.18.2 → 0.18.3
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.
- checksums.yaml +4 -4
- data/lib/common/error_interceptor.rb +18 -25
- data/lib/statelydb.rb +2 -2
- data/sig/statelydb.rbi +0 -43
- data/sig/statelydb.rbs +0 -31
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07b296b0a2f8dda95a010bd074b91c653f8a5c45cf2a6fc0418d7b158644ca8
|
4
|
+
data.tar.gz: cf3895a85a5090c62c87bda2d2bf75d0d6ae7a668c1f8dfb5bb2e4068399fdeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0644d032470017c1a692713fd1a9f06633e836af51c59a20bf4859c21d94e67031c58db6fa70e72ef5055594eb305cad2b961cd4437c280d8147d7ed9e8aefea
|
7
|
+
data.tar.gz: 64d33d0c37809b0a819014ea38cba6ec506d313a163e09286dbd20944291d9d49f34cfc21d042f80a85aeb2050bccc72d8b843061bbae5dc63e882b09802ca41
|
@@ -7,33 +7,26 @@ module StatelyDB
|
|
7
7
|
module Common
|
8
8
|
# GRPC interceptor to convert errors to StatelyDB::Error
|
9
9
|
class ErrorInterceptor < GRPC::ClientInterceptor
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
# client streaming interceptor
|
18
|
-
def client_streamer(requests:, call:, method:, metadata:) # rubocop:disable Lint/UnusedMethodArgument
|
19
|
-
yield
|
20
|
-
rescue Exception => e
|
21
|
-
raise StatelyDB::Error.from(e)
|
10
|
+
# Client and Server stream handling logic
|
11
|
+
%i[request_response client_streamer server_streamer bidi_streamer].each do |method_name|
|
12
|
+
define_method(method_name) do |*args, &block|
|
13
|
+
safe_yield(*args, &block)
|
14
|
+
end
|
22
15
|
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
end
|
20
|
+
def safe_yield(*, &block)
|
21
|
+
block.call(*)
|
22
|
+
rescue Exception => e
|
23
|
+
raise StatelyDB::Error.from(e)
|
24
|
+
end
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
rescue Exception => e
|
35
|
-
raise StatelyDB::Error.from(e)
|
36
|
-
end
|
37
|
-
end
|
26
|
+
def safe_yield_stream(stream, &block)
|
27
|
+
stream.each do |msg|
|
28
|
+
safe_yield(msg, &block)
|
38
29
|
end
|
30
|
+
rescue Exception => e
|
31
|
+
raise StatelyDB::Error.from(e)
|
39
32
|
end
|
data/lib/statelydb.rb
CHANGED
@@ -331,7 +331,7 @@ module StatelyDB
|
|
331
331
|
def process_list_response(resp)
|
332
332
|
items = []
|
333
333
|
token = nil
|
334
|
-
resp
|
334
|
+
safe_yield_stream(resp) do |r|
|
335
335
|
case r.response
|
336
336
|
when :result
|
337
337
|
r.result.items.map do |result|
|
@@ -360,7 +360,7 @@ module StatelyDB
|
|
360
360
|
updated_outside_list_window_paths = []
|
361
361
|
token = nil
|
362
362
|
is_reset = false
|
363
|
-
resp
|
363
|
+
safe_yield_stream(resp) do |r|
|
364
364
|
case r.response
|
365
365
|
when :result
|
366
366
|
r.result.changed_items.each do |item|
|
data/sig/statelydb.rbi
CHANGED
@@ -757,49 +757,6 @@ module StatelyDB
|
|
757
757
|
|
758
758
|
# GRPC interceptor to convert errors to StatelyDB::Error
|
759
759
|
class ErrorInterceptor < GRPC::ClientInterceptor
|
760
|
-
# client unary interceptor
|
761
|
-
sig do
|
762
|
-
params(
|
763
|
-
request: T.untyped,
|
764
|
-
call: T.untyped,
|
765
|
-
method: T.untyped,
|
766
|
-
metadata: T.untyped
|
767
|
-
).returns(T.untyped)
|
768
|
-
end
|
769
|
-
def request_response(request:, call:, method:, metadata:); end
|
770
|
-
|
771
|
-
# client streaming interceptor
|
772
|
-
sig do
|
773
|
-
params(
|
774
|
-
requests: T.untyped,
|
775
|
-
call: T.untyped,
|
776
|
-
method: T.untyped,
|
777
|
-
metadata: T.untyped
|
778
|
-
).returns(T.untyped)
|
779
|
-
end
|
780
|
-
def client_streamer(requests:, call:, method:, metadata:); end
|
781
|
-
|
782
|
-
# server streaming interceptor
|
783
|
-
sig do
|
784
|
-
params(
|
785
|
-
request: T.untyped,
|
786
|
-
call: T.untyped,
|
787
|
-
method: T.untyped,
|
788
|
-
metadata: T.untyped
|
789
|
-
).returns(T.untyped)
|
790
|
-
end
|
791
|
-
def server_streamer(request:, call:, method:, metadata:); end
|
792
|
-
|
793
|
-
# bidirectional streaming interceptor
|
794
|
-
sig do
|
795
|
-
params(
|
796
|
-
requests: T.untyped,
|
797
|
-
call: T.untyped,
|
798
|
-
method: T.untyped,
|
799
|
-
metadata: T.untyped
|
800
|
-
).returns(T.untyped)
|
801
|
-
end
|
802
|
-
def bidi_streamer(requests:, call:, method:, metadata:); end
|
803
760
|
end
|
804
761
|
end
|
805
762
|
|
data/sig/statelydb.rbs
CHANGED
@@ -651,37 +651,6 @@ module StatelyDB
|
|
651
651
|
|
652
652
|
# GRPC interceptor to convert errors to StatelyDB::Error
|
653
653
|
class ErrorInterceptor < GRPC::ClientInterceptor
|
654
|
-
# client unary interceptor
|
655
|
-
def request_response: (
|
656
|
-
request: untyped,
|
657
|
-
call: untyped,
|
658
|
-
method: untyped,
|
659
|
-
metadata: untyped
|
660
|
-
) -> untyped
|
661
|
-
|
662
|
-
# client streaming interceptor
|
663
|
-
def client_streamer: (
|
664
|
-
requests: untyped,
|
665
|
-
call: untyped,
|
666
|
-
method: untyped,
|
667
|
-
metadata: untyped
|
668
|
-
) -> untyped
|
669
|
-
|
670
|
-
# server streaming interceptor
|
671
|
-
def server_streamer: (
|
672
|
-
request: untyped,
|
673
|
-
call: untyped,
|
674
|
-
method: untyped,
|
675
|
-
metadata: untyped
|
676
|
-
) -> untyped
|
677
|
-
|
678
|
-
# bidirectional streaming interceptor
|
679
|
-
def bidi_streamer: (
|
680
|
-
requests: untyped,
|
681
|
-
call: untyped,
|
682
|
-
method: untyped,
|
683
|
-
metadata: untyped
|
684
|
-
) -> untyped
|
685
654
|
end
|
686
655
|
end
|
687
656
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statelydb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stately Cloud, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|