From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4C61646970E for ; Tue, 17 Dec 2019 17:11:23 +0300 (MSK) Date: Tue, 17 Dec 2019 17:11:19 +0300 From: Alexander Turenko Message-ID: <20191217141119.siiy67yzt5zw32wd@tkn_work_nb> References: <20191205155306.13157-1-sergeiv@tarantool.org> <20191216235413.knmpld2poafxhg7m@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191216235413.knmpld2poafxhg7m@tkn_work_nb> Subject: Re: [Tarantool-patches] [PATCH] Add console.print() alias for box.session.push() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Voinov Cc: tarantool-patches@dev.tarantool.org > > +-- > > +-- 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.