[PATCH 3/7] box/console: Add explicit output EOS mapping

Alexander Turenko alexander.turenko at tarantool.org
Fri Oct 25 03:00:22 MSK 2019


> +-- This is an end-of-stream marker for text output of Tarantool
> +-- server, for different output formats - yaml and Lua.
> +--
> +-- While for yaml ... is a standard stream end marker, using ';'
> +-- for Lua output we're walking on a thin ice - ';' is legal inside
> +-- a valid Lua block as well. But since this marker is used when
> +-- reading data created by a Tarantool server, we can rely on it not
> +-- being present inside of stream, since Tarantool server never
> +-- puts it inside of a stream.
> +local output_eos = { ["yaml"] = '\n...\n', ["lua"] = ';' }

I run a tarantool instance and type the following:

 $ tarantool
 | console = require('console')
 | console.listen('127.0.0.1:3311')

Then I connect to the listening console remotely:

 $ tarantoolctl connect localhost:3311
 | connected to localhost:3311
 | localhost:3311> \set output lua
 | true;
 | localhost:3311> ';'
 | ";
 | localhost:3311> <hit Enter>
 | ";
 | localhost:3311> <hit Enter>
 | ;
 | localhost:3311> 

Should not we wait for ';\n'?




More information about the Tarantool-patches mailing list