Document iproto override using event triggers
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Related dev. issue(s): https://github.com/tarantool/tarantool/issues/8138
Product: Tarantool
Since: 3.1
Root document: a new trigger page in https://www.tarantool.io/en/doc/latest/reference/reference_lua/
SME: @ Gumix
Details
Since Tarantool 3.1 there are 2 ways to override iproto request handlers:
-
Using
box.iproto.override(), introduced in Tarantool 2.11:
https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_iproto/override/ -
Using universal trigger registry: tarantool/doc#3988
To override an iproto request handler for the given request type, one can
set a trigger (or multiple triggers) on the corresponding event.
There are 2 types of iproto-overriding events:
- set by request type id, e.g.:
box.iproto.override[1]box.iproto.override[-1]
- set by request type name (the name must be in the lowercase), e.g.:
box.iproto.override.selectbox.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.
If some request type is overridden by both interfaces (legacy
box.iproto.override() and new trigger.set()), the order of invocation
of those handlers is unspecified.
Requested by @ Gumix in https://github.com/tarantool/tarantool/commit/6fed99bc85d6f540e81dfa500e5bea37a616f5d6.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the new trigger page under the Lua reference and compare it with the existing box.iproto.override() documentation and related issue #8138. Document the two event forms, trigger ordering and return behavior, unknown request handling, and interaction with the legacy interface; done means the page covers the requested Tarantool 3.1 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100