Skip to content

Commit 7804bfe

Browse files
committed
api: make Call = Call17
Closes #235
1 parent 724002d commit 7804bfe

16 files changed

+185
-320
lines changed

.github/workflows/testing.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ jobs:
9999
make test
100100
make testrace
101101
102-
- name: Run regression tests with call_17
103-
run: |
104-
make test TAGS="go_tarantool_call_17"
105-
make testrace TAGS="go_tarantool_call_17"
106-
107102
- name: Run fuzzing tests
108103
if: ${{ matrix.fuzzing }}
109104
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
@@ -189,14 +184,6 @@ jobs:
189184
env:
190185
TEST_TNT_SSL: ${{matrix.ssl}}
191186

192-
- name: Run regression tests with call_17
193-
run: |
194-
source tarantool-enterprise/env.sh
195-
make test TAGS="go_tarantool_call_17"
196-
make testrace TAGS="go_tarantool_call_17"
197-
env:
198-
TEST_TNT_SSL: ${{matrix.ssl}}
199-
200187
- name: Run fuzzing tests
201188
if: ${{ matrix.fuzzing }}
202189
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
@@ -363,12 +350,6 @@ jobs:
363350
make test
364351
make testrace
365352
366-
- name: Run regression tests with call_17
367-
run: |
368-
cd "${SRCDIR}"
369-
make test TAGS="go_tarantool_call_17"
370-
make testrace TAGS="go_tarantool_call_17"
371-
372353
- name: Run fuzzing tests
373354
if: ${{ matrix.fuzzing }}
374355
run: |

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
@@ -30,6 +30,7 @@ faster than other packages according to public benchmarks.
3030
* [multi package](#multi-package)
3131
* [pool package](#pool-package)
3232
* [msgpack.v5](#msgpackv5)
33+
* [Call = Call17](#call--call17)
3334
* [Contributing](#contributing)
3435
* [Alternative connectors](#alternative-connectors)
3536

@@ -66,13 +67,7 @@ This allows us to introduce new features without losing backward compatibility.
6667
```
6768
go_tarantool_ssl_disable
6869
```
69-
2. To change the default `Call` behavior from `Call16` to `Call17`, you can use
70-
the build tag:
71-
```
72-
go_tarantool_call_17
73-
```
74-
**Note:** In future releases, `Call17` may be used as default `Call` behavior.
75-
3. To run fuzz tests with decimals, you can use the build tag:
70+
2. To run fuzz tests with decimals, you can use the build tag:
7671
```
7772
go_tarantool_decimal_fuzzing
7873
```
@@ -188,6 +183,13 @@ There are also changes in the logic that can lead to errors in the old code,
188183
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
189184
we don't go this way. We use standard settings if it possible.
190185

186+
#### Call = Call17
187+
188+
Call requests uses `IPROTO_CALL` instead of `IPROTO_CALL_16`.
189+
190+
So now `Call` = `Call17` and `NewCallRequest` = `NewCall17Request`. A result
191+
of the requests is an array instead of array of arrays.
192+
191193
## Contributing
192194

193195
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
@@ -345,10 +345,9 @@ func (connPool *ConnectionPool) Upsert(space interface{}, tuple, ops interface{}
345345
return conn.Upsert(space, tuple, ops)
346346
}
347347

348-
// Call16 calls registered Tarantool function.
349-
// It uses request code for Tarantool >= 1.7 if go-tarantool
350-
// was build with go_tarantool_call_17 tag.
351-
// Otherwise, uses request code for Tarantool 1.6.
348+
// Call calls registered Tarantool function.
349+
// It uses request code for Tarantool >= 1.7, so result is not converted
350+
// (though, keep in mind, result is always array).
352351
func (connPool *ConnectionPool) Call(functionName string, args interface{}, userMode Mode) (resp *tarantool.Response, err error) {
353352
conn, err := connPool.getNextConnection(userMode)
354353
if err != nil {
@@ -466,9 +465,8 @@ func (connPool *ConnectionPool) UpdateTyped(space, index interface{}, key, ops i
466465
}
467466

468467
// CallTyped calls registered function.
469-
// It uses request code for Tarantool >= 1.7 if go-tarantool
470-
// was build with go_tarantool_call_17 tag.
471-
// Otherwise, uses request code for Tarantool 1.6.
468+
// It uses request code for Tarantool >= 1.7, so result is not converted
469+
// (though, keep in mind, result is always array).
472470
func (connPool *ConnectionPool) CallTyped(functionName string, args interface{}, result interface{}, userMode Mode) (err error) {
473471
conn, err := connPool.getNextConnection(userMode)
474472
if err != nil {
@@ -588,9 +586,8 @@ func (connPool *ConnectionPool) UpsertAsync(space interface{}, tuple interface{}
588586
}
589587

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

0 commit comments

Comments
 (0)