Skip to content

Commit

Permalink
chore(fiber): add comment explaining the situation
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoshkin committed Nov 1, 2021
1 parent e09d688 commit 5cbe60e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tarantool/src/fiber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ pub struct LuaFiber<C> {
callee: C,
}

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

0 comments on commit 5cbe60e

Please sign in to comment.