Skip to content

Commit 5cbe60e

Browse files
committed
chore(fiber): add comment explaining the situation
1 parent e09d688 commit 5cbe60e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tarantool/src/fiber.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ pub struct LuaFiber<C> {
418418
callee: C,
419419
}
420420

421+
/// Deferred non-yielding fiber implemented using **lua** api. This (hopefully)
422+
/// temporary implementation is a workaround. Tarantool C API lacks the method
423+
/// for passing the necessary information into the underlying `struct fiber`
424+
/// reliably. In this case we need to be able to set the `void *f_arg` field to
425+
/// be able to implement correct deferred fibers which don't yield.
421426
impl<C> LuaFiber<C>
422427
where
423428
C: LuaCallee,
@@ -431,7 +436,6 @@ where
431436
let Self { callee } = self;
432437
let fiber_ref = unsafe {
433438
let l = ffi::luaT_state();
434-
// TODO don't require("fiber") everytime
435439
lua::lua_getglobal(l, c_ptr!("require"));
436440
lua::lua_pushstring(l, c_ptr!("fiber"));
437441
if lua::lua_pcall(l, 1, 1, 0) == lua::LUA_ERRRUN {

0 commit comments

Comments
 (0)