[tarantool-patches] Re: [PATCH 6/8] netbox: introduce fiber-async API
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Mon Apr 23 21:59:19 MSK 2018
Hello. Thanks for review!
On 23/04/2018 15:31, Alexander Turenko wrote:
> Hi Vlad!
>
> Minor wording comments are below (Vlad asks to track it here).
>
> WBR, Alexander Turenko.
>
> On Mon, Apr 16, 2018 at 09:39:16PM +0300, Vladislav Shpilevoy wrote:
>> Now any netbox call blocks a caller-fiber until a result is read
>> from a socket, or time is out. To use it asynchronously it is
>> necessary to create a fiber per request. Sometimes it is
>> unwanted - for example if RPS is very high (for example, about
>> 100k), and latency is about 1 second. Or when it is neccessary
>> to send multiple requests in paralles and then collect responses
>> (map-reduce).
>
> Paralles -> parallel.
>
>> + function request_index:wait_result(timeout)
>> ...
>> + if not self:is_ready() then
>> + -- When a response is ready before timeout, the
>> + -- waiting client is waked up spuriously.
>
> Do you mean prematurely?
Fixed on branch.
diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
index 85f31b8e8..e3680006e 100644
--- a/src/box/lua/net_box.lua
+++ b/src/box/lua/net_box.lua
@@ -286,7 +286,7 @@ local function create_transport(host, port, user, password, callback,
end
if not self:is_ready() then
-- When a response is ready before timeout, the
- -- waiting client is waked up spuriously.
+ -- waiting client is waked up prematurely.
local old_client = self.client
self.client = fiber.self()
while timeout > 0 and not self:is_ready() do
More information about the Tarantool-patches
mailing list