[Tarantool-patches] [PATCH] Add console.print() alias for box.session.push()

Alexander Turenko alexander.turenko at tarantool.org
Tue Dec 17 17:11:19 MSK 2019


> > +--
> > +-- Alias for box.session.push
> > +--
> > +local function print(message, sync)
> 
> <...>
>
> 'sync' is not used here, see console_session_push() comment:
> 
>  | /**
>  |  * Push a tagged YAML document into a console socket.
>  |  * @param session Console session.
>  |  * @param sync Unused request sync.
>  |  * @param port Port with YAML to push.
>  |  *
>  |  * @retval  0 Success.
>  |  * @retval -1 Error.
>  |  */
>  | static int
>  | console_session_push(struct session *session, uint64_t sync, struct port *port)
> 
> Your last test case shows it: we pass some random 'sync', but anyway
> receive a push from a console. The parameter exists, because
> box.session.push() API is general mechanism. It just ignored for 'repl'
> and 'console' sessions (see [2]).
> 
> Since console.print() is console specific rather then general I don't
> see a reason to support 'sync' argument here. Moreover I would restrict
> it for 'repl' and 'console' sessions: let's make it no-op otherwise
> (because debug prints should not raise an error IMHO).

FYI: I filed https://github.com/tarantool/tarantool/issues/4689 to
remove `sync` argument from box.sesison.push().

WBR, Alexander Turenko.


More information about the Tarantool-patches mailing list