devinus/poolboy

Weird Timeout logic question

miros opened this issue · 1 comments

I can not understand logic behind checkout function. One value (Timeout) is used as both miliseconds in gen_server:call and microseconds in Deadline.
Is this weird logic intended?

checkout(Pool, Block, Timeout) ->
    {MegaSecs, Secs, MicroSecs} = os:timestamp(),
    Deadline = {MegaSecs, Secs, MicroSecs + Timeout},
    gen_server:call(Pool, {checkout, Block, Deadline}, Timeout).