Skip to content

Add call request methods for tarantool Request interface implementation. #30

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sugar.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import (
"context"
"fmt"

"github.com/tarantool/go-iproto"
"github.com/tarantool/go-tarantool/v2/pool"
)

@@ -83,6 +84,22 @@ func (req *CallRequest) Context(ctx context.Context) *CallRequest {
return req
}

// Type returns the type of the request, which is always IProto Call.
func (req *CallRequest) Type() iproto.Type {
return iproto.IPROTO_CALL
}

// Ctx returns the context associated with the request,
// which can be used for cancellation, deadlines, etc.
func (req *CallRequest) Ctx() context.Context {
return req.ctx
}

// Async returns false to the request return a response.
func (req *CallRequest) Async() bool {
return false
}

// BucketID method that sets the bucketID for your request.
// You can ignore this parameter if you have a bucketGetter.
// However, this method has a higher priority.