Skip to content

Commit ca7e50e

Browse files
committed
api: make Call = Call17
Closes #235
1 parent 26731d0 commit ca7e50e

16 files changed

+185
-314
lines changed

.github/workflows/testing.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ jobs:
101101
make test
102102
make testrace
103103
104-
- name: Run regression tests with call_17
105-
run: |
106-
make test TAGS="go_tarantool_call_17"
107-
make testrace TAGS="go_tarantool_call_17"
108-
109104
- name: Run fuzzing tests
110105
if: ${{ matrix.fuzzing }}
111106
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
@@ -191,14 +186,6 @@ jobs:
191186
env:
192187
TEST_TNT_SSL: ${{matrix.ssl}}
193188

194-
- name: Run regression tests with call_17
195-
run: |
196-
source tarantool-enterprise/env.sh
197-
make test TAGS="go_tarantool_call_17"
198-
make testrace TAGS="go_tarantool_call_17"
199-
env:
200-
TEST_TNT_SSL: ${{matrix.ssl}}
201-
202189
- name: Run fuzzing tests
203190
if: ${{ matrix.fuzzing }}
204191
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
2020

2121
- connection_pool renamed to pool (#239)
2222
- msgpack/v5 is default at now (#236)
23+
- Call/NewCallRequest = Call17/NewCall17Request (#235)
2324

2425
### Removed
2526

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ faster than other packages according to public benchmarks.
3535
* [multi removed](#multi-subpackage)
3636
* [connection_pool renamed to pool](#pool-subpackage)
3737
* [msgpack.v5 migration](#msgpackv5-migration)
38+
* [Call = Call17](#call--call17)
3839
* [Contributing](#contributing)
3940
* [Alternative connectors](#alternative-connectors)
4041

@@ -71,13 +72,7 @@ This allows us to introduce new features without losing backward compatibility.
7172
```
7273
go_tarantool_ssl_disable
7374
```
74-
2. To change the default `Call` behavior from `Call16` to `Call17`, you can use
75-
the build tag:
76-
```
77-
go_tarantool_call_17
78-
```
79-
**Note:** In future releases, `Call17` may be used as default `Call` behavior.
80-
3. To run fuzz tests with decimals, you can use the build tag:
75+
2. To run fuzz tests with decimals, you can use the build tag:
8176
```
8277
go_tarantool_decimal_fuzzing
8378
```
@@ -190,6 +185,13 @@ There are also changes in the logic that can lead to errors in the old code,
190185
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
191186
we don't go this way. We use standard settings if it possible.
192187

188+
#### Call = Call17
189+
190+
Call requests uses IPROTO_CALL instead of IPROTO_CALL_16.
191+
192+
So now Call = Call17 and NewCallRequest = NewCall17Request. A result of the
193+
requests is an array instead of array of arrays.
194+
193195
## Contributing
194196

195197
See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how

call_16_test.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

call_17_test.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

const.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const (
2121
IdRequestCode = 73
2222
WatchRequestCode = 74
2323
UnwatchRequestCode = 75
24+
CallRequestCode = Call17RequestCode
2425

2526
KeyCode = 0x00
2627
KeySync = 0x01

const_call_16.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

const_call_17.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

pool/call_16_test.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

pool/call_17_test.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

pool/connection_pool.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,9 @@ func (connPool *ConnectionPool) Upsert(space interface{}, tuple, ops interface{}
341341
return conn.Upsert(space, tuple, ops)
342342
}
343343

344-
// Call16 calls registered Tarantool function.
345-
// It uses request code for Tarantool >= 1.7 if go-tarantool
346-
// was build with go_tarantool_call_17 tag.
347-
// Otherwise, uses request code for Tarantool 1.6.
344+
// Call calls registered Tarantool function.
345+
// It uses request code for Tarantool >= 1.7, so result is not converted
346+
// (though, keep in mind, result is always array).
348347
func (connPool *ConnectionPool) Call(functionName string, args interface{}, userMode Mode) (resp *tarantool.Response, err error) {
349348
conn, err := connPool.getNextConnection(userMode)
350349
if err != nil {
@@ -462,9 +461,8 @@ func (connPool *ConnectionPool) UpdateTyped(space, index interface{}, key, ops i
462461
}
463462

464463
// CallTyped calls registered function.
465-
// It uses request code for Tarantool >= 1.7 if go-tarantool
466-
// was build with go_tarantool_call_17 tag.
467-
// Otherwise, uses request code for Tarantool 1.6.
464+
// It uses request code for Tarantool >= 1.7, so result is not converted
465+
// (though, keep in mind, result is always array).
468466
func (connPool *ConnectionPool) CallTyped(functionName string, args interface{}, result interface{}, userMode Mode) (err error) {
469467
conn, err := connPool.getNextConnection(userMode)
470468
if err != nil {
@@ -584,9 +582,8 @@ func (connPool *ConnectionPool) UpsertAsync(space interface{}, tuple interface{}
584582
}
585583

586584
// CallAsync sends a call to registered Tarantool function and returns Future.
587-
// It uses request code for Tarantool >= 1.7 if go-tarantool
588-
// was build with go_tarantool_call_17 tag.
589-
// Otherwise, uses request code for Tarantool 1.6.
585+
// It uses request code for Tarantool >= 1.7, so future's result will not be converted
586+
// (though, keep in mind, result is always array).
590587
func (connPool *ConnectionPool) CallAsync(functionName string, args interface{}, userMode Mode) *tarantool.Future {
591588
conn, err := connPool.getNextConnection(userMode)
592589
if err != nil {

0 commit comments

Comments
 (0)