Top.Mail.Ru
box.session.type() | Tarantool
Tarantool
Check out the new release 2.8

box.session.type()

box.session.type()
Return:the type of connection or cause of action.
Rtype:string

Possible return values are:

  • ‘binary’ if the connection was done via the binary protocol, for example to a target made with box.cfg{listen=…};
  • ‘console’ if the connection was done via the administrative console, for example to a target made with console.listen;
  • ‘repl’ if the connection was done directly, for example when using Tarantool as a client;
  • ‘applier’ if the action is due to replication, regardless of how the connection was done;
  • ‘background’ if the action is in a background fiber, regardless of whether the Tarantool server was started in the background.

box.session.type() is useful for an on_replace() trigger on a replica – the value will be ‘applier’ if and only if the trigger was activated because of a request that was done on the master.