Skip to content
Snippets Groups Projects
Commit 98c91930 authored by Ilya Verbin's avatar Ilya Verbin Committed by Serge Petrenko
Browse files

iproto: override request handlers using event triggers (part 1)


This patch allows to override IPROTO request handlers by setting triggers
on the corresponding events before the initial `box.cfg{}' call.
For triggers that are set after the first `box.cfg{}', see next commit.

There are 2 types of iproto-overriding events:
 1. set by request type id, e.g.:
     - box.iproto.override[1]
     - box.iproto.override[-1]
 2. set by request type name (the name must be in the lowercase), e.g.:
     - box.iproto.override.select
     - box.iproto.override.unknown

Override-by-id allows to set a handler for a particular request type, that
is not known by the given version of Tarantool. This is not possible with
override-by-name, where a type name must be known by Tarantool. Also there
are a special type name "unknown" and a type id box.iproto.type.UNKNOWN
(== -1) that allow to set a single handler for all unknown request types.

Multiple triggers can be associated with a single event. The triggers are
called in reverse order of their installation, however triggers set by id
are called before triggers set by name.

If a trigger returns `false`, the next trigger in the list is called, or a
system handler if there are no more triggers. If a trigger returns `true`,
no more triggers or system handlers are called.

Part of #8138

NO_DOC=see next commit
NO_CHANGELOG=see next commit

Co-authored-by: default avatarAndrey Saranchin <Andrey22102001@gmail.com>
parent 2515ab16
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment