Skip to content

Add CallAsync analogue without a context #62

Open
@oleg-jukovec

Description

@oleg-jukovec

The context usage:

Context(ctx).

leads to creating a goroutine for each request. It's very expensive (especially in context.Background() case). A faster way is to rely on setting a timeout on the entire connection with tarantool.Opts.Timeout:

https://github.com/tarantool/go-tarantool/blob/c0a8ad307468471132652fb3829525b813762bc7/connection.go#L281-L292

So there is should be something like (need to think about naming):

func (rs *Replicaset) CallAsyncWithTimeout(opts ReplicasetCallOpts, fnc string, args interface{}) *tarantool.Future {

I would suggest adapting the request logic from the Go connector in the v3 library. This logic with FooAsync, FooTyped, FooWithContext, FooWithoutContextAsync it only seems simple, but in fact it is hard to maintain all this stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions