@@ -15,45 +15,45 @@ def initialize(router, command_builder)
15
15
@size = 0
16
16
end
17
17
18
- def call ( *args , **kwargs )
18
+ def call ( *args , **kwargs , & block )
19
19
command = @command_builder . generate ( args , kwargs )
20
20
node_key = @router . find_node_key ( command , primary_only : true )
21
- @grouped [ node_key ] += [ [ @size , :call_v , command ] ]
21
+ @grouped [ node_key ] += [ [ @size , :call_v , command , block ] ]
22
22
@size += 1
23
23
end
24
24
25
- def call_v ( args )
25
+ def call_v ( args , & block )
26
26
command = @command_builder . generate ( args )
27
27
node_key = @router . find_node_key ( command , primary_only : true )
28
- @grouped [ node_key ] += [ [ @size , :call_v , command ] ]
28
+ @grouped [ node_key ] += [ [ @size , :call_v , command , block ] ]
29
29
@size += 1
30
30
end
31
31
32
- def call_once ( *args , **kwargs )
32
+ def call_once ( *args , **kwargs , & block )
33
33
command = @command_builder . generate ( args , kwargs )
34
34
node_key = @router . find_node_key ( command , primary_only : true )
35
- @grouped [ node_key ] += [ [ @size , :call_once_v , command ] ]
35
+ @grouped [ node_key ] += [ [ @size , :call_once_v , command , block ] ]
36
36
@size += 1
37
37
end
38
38
39
- def call_once_v ( args )
39
+ def call_once_v ( args , & block )
40
40
command = @command_builder . generate ( args )
41
41
node_key = @router . find_node_key ( command , primary_only : true )
42
- @grouped [ node_key ] += [ [ @size , :call_once_v , command ] ]
42
+ @grouped [ node_key ] += [ [ @size , :call_once_v , command , block ] ]
43
43
@size += 1
44
44
end
45
45
46
- def blocking_call ( timeout , *args , **kwargs )
46
+ def blocking_call ( timeout , *args , **kwargs , & block )
47
47
command = @command_builder . generate ( args , kwargs )
48
48
node_key = @router . find_node_key ( command , primary_only : true )
49
- @grouped [ node_key ] += [ [ @size , :blocking_call_v , timeout , command ] ]
49
+ @grouped [ node_key ] += [ [ @size , :blocking_call_v , timeout , command , block ] ]
50
50
@size += 1
51
51
end
52
52
53
- def blocking_call_v ( timeout , args )
53
+ def blocking_call_v ( timeout , args , & block )
54
54
command = @command_builder . generate ( args )
55
55
node_key = @router . find_node_key ( command , primary_only : true )
56
- @grouped [ node_key ] += [ [ @size , :blocking_call_v , timeout , command ] ]
56
+ @grouped [ node_key ] += [ [ @size , :blocking_call_v , timeout , command , block ] ]
57
57
@size += 1
58
58
end
59
59
@@ -69,8 +69,8 @@ def execute # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Met
69
69
Thread . new ( @router , k , v ) do |router , node_key , rows |
70
70
Thread . pass
71
71
replies = router . find_node ( node_key ) . pipelined do |pipeline |
72
- rows . each do |( _size , *row ) |
73
- pipeline . send ( *row )
72
+ rows . each do |( _size , *row , block ) |
73
+ pipeline . send ( *row , & block )
74
74
end
75
75
end
76
76
0 commit comments