-
Notifications
You must be signed in to change notification settings - Fork 60
Support IPROTO_PUSH #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
yes, it will huge refactor. I will cobine it with new API. |
IPROTO_PUSH is broken by desing.
I think that we should
|
I agree that Details are here: tarantool/tarantool#6107. In my humble opinion IPROTO_PUSH support would be convenient for notifications about a long request status despite highlighted problems. Another point is that Anyway, Dmitry asked for a pause to think and decide what is better to do here and, well, 'think than do' is better than vice versa :) |
NB: https://github.com/FZambia/tarantool supports |
We can add a stateful iterator with an interface type ResponseIterator interface {
Next() (bool)
Value() (*Response)
Err() (error)
} and a function to get an interface implementation from the Future type: func (fut *Future) GetIterator() ResponseIterator {
// creates and returns an object of private type that implements ResponseIterator
} Then a client-side code will look like this: var fut *Future
var it ResponseIterator
var err error
fut = conn.CallAsync("server_function", []interface{}{})
for it = fut.GetIterator(); it.Next(); {
resp := it.Value()
if (resp.Code == PushCode) { // PushCode == IPROTO_PUSH == 0x80
// push message
} else {
// regular response
}
}
if err = it.Err(); err != nil {
// an error happens
}
for it = fut.GetIterator().WithTimeout(1 * time.Second); it.Next(); {
resp := it.Value()
if (resp.Code == PushCode) { // PushCode == IPROTO_PUSH == 0x80
// push message
} else {
// regular response
}
}
if err = it.Err(); err != nil {
// an error happens
} The code handle an asynchronous case from a Lua implementation in the same way, see examples on Lua. A synchronous case will require much more changes. If we try to extend the current implementation with additional functions for passing callbacks, it will not look very nice with a lot of duplication code. It seems to me that now it would be better to support only the asynchronous case. |
This patch adds support for receiving messages sent using box.session.push() via an iterator in the manner of asynchronous case of a Lua implementation[1]. Now the calls Future.Get() and Future.GetTyped() ignore push messages, and do not report an error. 1. https://www.tarantool.io/ru/doc/latest/reference/reference_lua/box_session/push/ Closes #67
Overview This release adds a number of features. The extending of the public API has become possible with a new way of creating requests. New types of requests are created via chain calls: selectReq := NewSelectRequest("space"). Context(ctx). Index(1). Offset(5). Limit(10) future := conn.Do(selectReq) Streams, context and prepared statements support are based on this idea: stream, err := conn.NewStream() beginReq := NewBeginRequest().Context(ctx) if response, err := stream.Do(beginReq).Get(); err != nil { selectFuture := stream.Do(selectReq) commitFuture := stream.Do(NewCommitRequest()) // ... } ``` Breaking changes NewErrorFuture function removed (#190). `IPROTO_*` constants that identify requests renamed from `<Name>Request` to `<Name>RequestCode` (#126) New features SSL support (#155). IPROTO_PUSH messages support (#67). Public API with request object types (#126). Support decimal type in msgpack (#96). Support datetime type in msgpack (#118). Prepared SQL statements (#117). Streams and interactive transactions support (#101). `Call16` method, support build tag `go_tarantool_call_17` to choose default behavior for `Call` method as Call17 (#125) Bugfixes Add `ExecuteAsync` and `ExecuteTyped` to common connector interface (#62).
Add context, streams, SQL and push messages support in Go connector Follows up tarantool/go-tarantool#48 Follows up tarantool/go-tarantool#62 Follows up tarantool/go-tarantool#67 Follows up tarantool/go-tarantool#101
Add context, streams, SQL and push messages support in Go connector Follows up tarantool/go-tarantool#48 Follows up tarantool/go-tarantool#62 Follows up tarantool/go-tarantool#67 Follows up tarantool/go-tarantool#101
Overview This release adds a number of features. The extending of the public API has become possible with a new way of creating requests. New types of requests are created via chain calls: selectReq := NewSelectRequest("space"). Context(ctx). Index(1). Offset(5). Limit(10) future := conn.Do(selectReq) Streams, context and prepared statements support are based on this idea: stream, err := conn.NewStream() beginReq := NewBeginRequest().Context(ctx) if response, err := stream.Do(beginReq).Get(); err != nil { selectFuture := stream.Do(selectReq) commitFuture := stream.Do(NewCommitRequest()) // ... } ``` Breaking changes NewErrorFuture function removed (#190). `IPROTO_*` constants that identify requests renamed from `<Name>Request` to `<Name>RequestCode` (#126) New features SSL support (#155). IPROTO_PUSH messages support (#67). Public API with request object types (#126). Support decimal type in msgpack (#96). Support datetime type in msgpack (#118). Prepared SQL statements (#117). Streams and interactive transactions support (#101). `Call16` method, support build tag `go_tarantool_call_17` to choose default behavior for `Call` method as Call17 (#125) Bugfixes Add `ExecuteAsync` and `ExecuteTyped` to common connector interface (#62).
Overview This release adds a number of features. The extending of the public API has become possible with a new way of creating requests. New types of requests are created via chain calls: selectReq := NewSelectRequest("space"). Context(ctx). Index(1). Offset(5). Limit(10) future := conn.Do(selectReq) Streams, context and prepared statements support are based on this idea: stream, err := conn.NewStream() beginReq := NewBeginRequest().Context(ctx) if response, err := stream.Do(beginReq).Get(); err != nil { selectFuture := stream.Do(selectReq) commitFuture := stream.Do(NewCommitRequest()) // ... } ``` Breaking changes NewErrorFuture function removed (#190). `IPROTO_*` constants that identify requests renamed from `<Name>Request` to `<Name>RequestCode` (#126) New features SSL support (#155). IPROTO_PUSH messages support (#67). Public API with request object types (#126). Support decimal type in msgpack (#96). Support datetime type in msgpack (#118). Prepared SQL statements (#117). Context support for request objects (#48). Streams and interactive transactions support (#101). `Call16` method, support build tag `go_tarantool_call_17` to choose default behavior for `Call` method as Call17 (#125) Bugfixes Add `ExecuteAsync` and `ExecuteTyped` to common connector interface (#62).
Overview This release adds a number of features. The extending of the public API has become possible with a new way of creating requests. New types of requests are created via chain calls: selectReq := NewSelectRequest("space"). Context(ctx). Index(1). Offset(5). Limit(10) future := conn.Do(selectReq) Streams, context and prepared statements support are based on this idea: stream, err := conn.NewStream() beginReq := NewBeginRequest().Context(ctx) if response, err := stream.Do(beginReq).Get(); err != nil { selectFuture := stream.Do(selectReq) commitFuture := stream.Do(NewCommitRequest()) // ... } ``` Breaking changes NewErrorFuture function removed (#190). `IPROTO_*` constants that identify requests renamed from `<Name>Request` to `<Name>RequestCode` (#126) New features SSL support (#155). IPROTO_PUSH messages support (#67). Public API with request object types (#126). Support decimal type in msgpack (#96). Support datetime type in msgpack (#118). Prepared SQL statements (#117). Context support for request objects (#48). Streams and interactive transactions support (#101). `Call16` method, support build tag `go_tarantool_call_17` to choose default behavior for `Call` method as Call17 (#125) Bugfixes Add `ExecuteAsync` and `ExecuteTyped` to common connector interface (#62).
Overview This release adds a number of features. The extending of the public API has become possible with a new way of creating requests. New types of requests are created via chain calls: selectReq := NewSelectRequest("space"). Context(ctx). Index(1). Offset(5). Limit(10) future := conn.Do(selectReq) Streams, context and prepared statements support are based on this idea: stream, err := conn.NewStream() beginReq := NewBeginRequest().Context(ctx) if response, err := stream.Do(beginReq).Get(); err != nil { selectFuture := stream.Do(selectReq) commitFuture := stream.Do(NewCommitRequest()) // ... } ``` Breaking changes NewErrorFuture function removed (#190). `IPROTO_*` constants that identify requests renamed from `<Name>Request` to `<Name>RequestCode` (#126) New features SSL support (#155). IPROTO_PUSH messages support (#67). Public API with request object types (#126). Support decimal type in msgpack (#96). Support datetime type in msgpack (#118). Prepared SQL statements (#117). Context support for request objects (#48). Streams and interactive transactions support (#101). `Call16` method, support build tag `go_tarantool_call_17` to choose default behavior for `Call` method as Call17 (#125) Bugfixes Add `ExecuteAsync` and `ExecuteTyped` to common connector interface (#62).
The patch adds context, streams, SQL, push messages and master discovery support for connection pool to go-tarantool. It also updates GitHub starts for Go connectors. Follows up tarantool/go-tarantool#48 Follows up tarantool/go-tarantool#62 Follows up tarantool/go-tarantool#67 Follows up tarantool/go-tarantool#101 Follows up tarantool/go-tarantool#113
Resolves #3094 The patch adds context, streams, SQL, push messages and master discovery support for connection pool to go-tarantool. It also updates GitHub starts for Go connectors. Follows up tarantool/go-tarantool#48 Follows up tarantool/go-tarantool#62 Follows up tarantool/go-tarantool#67 Follows up tarantool/go-tarantool#101 Follows up tarantool/go-tarantool#113
box.session.push() in 1.10 impements a new iproto command, IPROTO_PUSH. Please add support for it.
The text was updated successfully, but these errors were encountered: