neo4j-ruby-driver 4.4.0.alpha.3 → 4.4.0.alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/ruby/neo4j/driver/config.rb +1 -1
- data/ruby/neo4j/driver/internal/async/inbound/inbound_message_dispatcher.rb +1 -1
- data/ruby/neo4j/driver/internal/async/network_connection.rb +15 -22
- data/ruby/neo4j/driver/internal/async/pool/channel.rb +1 -0
- data/ruby/neo4j/driver/internal/async/pool/connection_pool_impl.rb +1 -0
- data/ruby/neo4j/driver/internal/handlers/channel_releasing_reset_response_handler.rb +11 -10
- data/ruby/neo4j/driver/internal/handlers/legacy_pull_all_response_handler.rb +1 -1
- data/ruby/neo4j/driver/internal/handlers/pulln/auto_pull_response_handler.rb +1 -2
- data/ruby/neo4j/driver/internal/handlers/reset_response_handler.rb +1 -1
- data/ruby/neo4j/driver/internal/internal_bookmark.rb +3 -5
- data/ruby/neo4j/driver/internal/internal_driver.rb +1 -1
- data/ruby/neo4j/driver/internal/internal_entity.rb +3 -5
- data/ruby/neo4j/driver/version.rb +1 -1
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1dc1f5cbdb0085a5e75fd3809b9e830c5c60e93f688e42c939c2fbe7015bde7
|
4
|
+
data.tar.gz: 81786afebfdb15a41550bf5997aef82adcb26ea8f5551a1e48e8c7571211e994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ba9e1ff39437d069150c3d7706a93c7b21054d2fb5e03ecc1bdc2cd864145bd2609cfca46448b0a84354f78ab983164b25bdcc12e8fb8b6061eea498c4651c3
|
7
|
+
data.tar.gz: 3549a85e58efeb737c6d48cde04ce8da6bd2e2d07d2b927ff8669a4a9fca390f621e60e7e6670d286b66cb242aff625b1112760e8470632a8f6a89464bae4c20
|
data/README.md
CHANGED
@@ -42,6 +42,7 @@ This gem includes 2 different implementations: java driver wrapper and pure ruby
|
|
42
42
|
## Testing
|
43
43
|
|
44
44
|
To run the tests the following tools need to be installed:
|
45
|
+
|
45
46
|
$ brew install python
|
46
47
|
$ pip3 install --user git+https://github.com/klobuczek/boltkit@1.3#egg=boltkit
|
47
48
|
$ neoctrl-install -e 4.4.5 servers
|
data/ruby/neo4j/driver/config.rb
CHANGED
@@ -79,7 +79,7 @@ module Neo4j
|
|
79
79
|
|
80
80
|
def init_security_and_trust_config
|
81
81
|
relevant = %i[encryption trust_strategy]
|
82
|
-
customized = slice(*relevant)
|
82
|
+
customized = slice(*relevant) != DEFAULTS.slice(*relevant)
|
83
83
|
merge!(security_settings: Neo4j::Driver::Internal::SecuritySetting.new(
|
84
84
|
fetch(:encryption), TrustStrategy.new(**fetch(:trust_strategy)), customized),
|
85
85
|
)
|
@@ -151,7 +151,7 @@ module Neo4j::Driver
|
|
151
151
|
@auto_read_managing_handler.disable_auto_read_management
|
152
152
|
|
153
153
|
# restore the default value of auto-read
|
154
|
-
@channel.
|
154
|
+
@channel.auto_read = true
|
155
155
|
end
|
156
156
|
|
157
157
|
@auto_read_managing_handler = new_handler
|
@@ -33,11 +33,11 @@ module Neo4j::Driver
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def enable_auto_read
|
36
|
-
|
36
|
+
@channel.auto_read = true if open?
|
37
37
|
end
|
38
38
|
|
39
39
|
def disable_auto_read
|
40
|
-
|
40
|
+
@channel.auto_read = false if open?
|
41
41
|
end
|
42
42
|
|
43
43
|
def flush
|
@@ -69,13 +69,12 @@ module Neo4j::Driver
|
|
69
69
|
|
70
70
|
def release
|
71
71
|
if @status.compare_and_set(Status::OPEN, Status::RELEASED)
|
72
|
-
|
72
|
+
handler = Handlers::ChannelReleasingResetResponseHandler.new(@channel, @channel_pool, @message_dispatcher, @log, @release)
|
73
|
+
write_reset_message_if_needed(handler, false)
|
74
|
+
# @metrics_listener.after_connection_released(Connection::ChannelAttributes.pool_id(@channel), @in_use_event)
|
75
|
+
# end
|
76
|
+
# @release_future
|
73
77
|
end
|
74
|
-
# handler = Handlers::ChannelReleasingResetResponseHandler.new(@channel, @channel_pool, @message_dispatcher, @clock, @release)
|
75
|
-
# write_reset_message_if_needed(handler, false)
|
76
|
-
# @metrics_listener.after_connection_released(Connection::ChannelAttributes.pool_id(@channel), @in_use_event)
|
77
|
-
# end
|
78
|
-
# @release_future
|
79
78
|
end
|
80
79
|
|
81
80
|
def terminate_and_release(reason)
|
@@ -91,15 +90,13 @@ module Neo4j::Driver
|
|
91
90
|
private
|
92
91
|
|
93
92
|
def write_reset_message_if_needed(reset_handler, is_session_reset)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
@channel.write_and_flush(Messaging::Request::ResetMessage::RESET).add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
102
|
-
end
|
93
|
+
if is_session_reset && !open?
|
94
|
+
reset_handler.on_success
|
95
|
+
else
|
96
|
+
# auto-read could've been disabled, re-enable it to automatically receive response for RESET
|
97
|
+
@channel.auto_read = true
|
98
|
+
@message_dispatcher.enqueue(reset_handler)
|
99
|
+
@channel.write_and_flush(Messaging::Request::ResetMessage::RESET)#.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
103
100
|
end
|
104
101
|
end
|
105
102
|
|
@@ -114,7 +111,7 @@ module Neo4j::Driver
|
|
114
111
|
@message_dispatcher.enqueue(handler)
|
115
112
|
|
116
113
|
if flush
|
117
|
-
@channel.write_and_flush(message)#.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
114
|
+
@channel.write_and_flush(message) #.add_listener(-> (_future) { register_connection_read_timeout(@channel) })
|
118
115
|
else
|
119
116
|
@channel.write(message)
|
120
117
|
end
|
@@ -135,10 +132,6 @@ module Neo4j::Driver
|
|
135
132
|
end
|
136
133
|
end
|
137
134
|
|
138
|
-
def set_auto_read(value)
|
139
|
-
@channel.config.set_auto_read(value)
|
140
|
-
end
|
141
|
-
|
142
135
|
def verify_open(handler1, handler2)
|
143
136
|
connection_status = @status.get
|
144
137
|
|
@@ -2,26 +2,27 @@ module Neo4j::Driver
|
|
2
2
|
module Internal
|
3
3
|
module Handlers
|
4
4
|
class ChannelReleasingResetResponseHandler < ResetResponseHandler
|
5
|
-
def initialize(channel, pool, message_dispatcher,
|
5
|
+
def initialize(channel, pool, message_dispatcher, log, release_future)
|
6
6
|
super(message_dispatcher, release_future)
|
7
7
|
@channel = channel
|
8
8
|
@pool = pool
|
9
|
-
@
|
9
|
+
@log = log
|
10
10
|
end
|
11
11
|
|
12
|
-
def reset_completed(
|
12
|
+
def reset_completed(success)
|
13
13
|
if success
|
14
14
|
# update the last-used timestamp before returning the channel back to the pool
|
15
|
-
Async::Connection::ChannelAttributes.set_last_used_timestamp(@channel, @clock.millis)
|
16
|
-
closure_stage = Util::Futures.completed_with_null
|
15
|
+
# Async::Connection::ChannelAttributes.set_last_used_timestamp(@channel, @clock.millis)
|
16
|
+
# closure_stage = Util::Futures.completed_with_null
|
17
17
|
else
|
18
18
|
# close the channel before returning it back to the pool if RESET failed
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
closure_stage.exceptionally(-> (_throwable) { nil }).then_compose(-> (_ignored) { @pool.release(@channel) }).when_complete do |_, _error|
|
23
|
-
completion_future.complete(nil)
|
19
|
+
@channel.close
|
24
20
|
end
|
21
|
+
rescue
|
22
|
+
nil
|
23
|
+
ensure
|
24
|
+
@pool.release(@channel)
|
25
|
+
@log.debug { "Channel #{@channel.object_id} released." }
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -212,7 +212,7 @@ module Neo4j::Driver
|
|
212
212
|
|
213
213
|
def extract_result_summary(metadata)
|
214
214
|
result_available_after = @run_response_handler.result_available_after
|
215
|
-
@
|
215
|
+
@metadata_extractor.extract_summary(@query, @connection, result_available_after, metadata)
|
216
216
|
end
|
217
217
|
|
218
218
|
def enable_auto_read
|
@@ -4,7 +4,6 @@ module Neo4j::Driver
|
|
4
4
|
module Pulln
|
5
5
|
class AutoPullResponseHandler < BasicPullResponseHandler
|
6
6
|
delegate :signal, to: :@records
|
7
|
-
UNINITIALIZED_RECORDS = ::Async::Queue.new
|
8
7
|
LONG_MAX_VALUE = 2 ** 63 - 1
|
9
8
|
|
10
9
|
def initialize(query, run_response_handler, connection, metadata_extractor, completion_listener, fetch_size)
|
@@ -20,7 +19,7 @@ module Neo4j::Driver
|
|
20
19
|
@low_record_watermark = fetch_size * 0.3
|
21
20
|
end
|
22
21
|
|
23
|
-
@records =
|
22
|
+
@records = ::Async::Queue.new
|
24
23
|
@auto_pull_enabled = true
|
25
24
|
|
26
25
|
install_record_and_summary_consumers
|
@@ -10,14 +10,12 @@ module Neo4j::Driver
|
|
10
10
|
@values = values.to_set
|
11
11
|
end
|
12
12
|
|
13
|
-
def eql?(other)
|
14
|
-
values.eql?(other.values)
|
15
|
-
end
|
16
|
-
|
17
13
|
def ==(other)
|
18
|
-
values == other.values
|
14
|
+
equal?(other) || self.class == other.class && values == other.values
|
19
15
|
end
|
20
16
|
|
17
|
+
alias eql? ==
|
18
|
+
|
21
19
|
def to_s
|
22
20
|
"Bookmark{values=#{values}}"
|
23
21
|
end
|
@@ -7,7 +7,7 @@ module Neo4j::Driver
|
|
7
7
|
# delegate :verify_connectivity, to: :session_factory
|
8
8
|
delegate :metrics, :metrics_enabled?, to: :metrics_provider
|
9
9
|
auto_closable :session
|
10
|
-
sync :close, :supports_multi_db?, :verify_connectivity
|
10
|
+
sync :close, :supports_multi_db?, :verify_connectivity, :session
|
11
11
|
|
12
12
|
def initialize(security_plan, session_factory, metrics_provider, logger)
|
13
13
|
@closed = Concurrent::AtomicBoolean.new(false)
|
@@ -10,13 +10,11 @@ module Neo4j::Driver
|
|
10
10
|
@properties = properties
|
11
11
|
end
|
12
12
|
|
13
|
-
def eql?(other)
|
14
|
-
id.eql?(other.id)
|
15
|
-
end
|
16
|
-
|
17
13
|
def ==(other)
|
18
|
-
id == other.id
|
14
|
+
equal?(other) || self.class == other.class && id == other.id
|
19
15
|
end
|
16
|
+
|
17
|
+
alias eql? ==
|
20
18
|
end
|
21
19
|
end
|
22
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-ruby-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.0.alpha.
|
4
|
+
version: 4.4.0.alpha.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heinrich Klobuczek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: async
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: zeitwerk
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +67,7 @@ dependencies:
|
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
70
|
+
name: async
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
@@ -95,7 +81,7 @@ dependencies:
|
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
84
|
+
name: ffaker
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - ">="
|
@@ -109,7 +95,7 @@ dependencies:
|
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
|
-
name: hoe
|
98
|
+
name: hoe
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - ">="
|
@@ -123,7 +109,7 @@ dependencies:
|
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: hoe-
|
112
|
+
name: hoe-bundler
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - ">="
|
@@ -137,7 +123,7 @@ dependencies:
|
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
126
|
+
name: hoe-gemspec
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - ">="
|