net.box: allow to store user-defined fields in future object
Before commit 954194a1 ("net.box: rewrite request implementation in C"), net.box future was a plain Lua table so that the caller could attach extra information to it. Now it isn't true anymore - a future is a userdata object, and it doesn't have indexing methods. For backward compatibility, let's add __index and __newindex fields and store user-defined fields in a Lua table, which is created lazily on the first __newindex invocation. __index falls back on the metatable methods if a field isn't found in the table. Follow-up #6241 Closes #6306
Showing
- src/box/lua/net_box.c 55 additions, 0 deletionssrc/box/lua/net_box.c
- test/box/net.box_fiber-async_gh-3107.result 104 additions, 5 deletionstest/box/net.box_fiber-async_gh-3107.result
- test/box/net.box_fiber-async_gh-3107.test.lua 36 additions, 3 deletionstest/box/net.box_fiber-async_gh-3107.test.lua
Loading
Please register or sign in to comment