Skip to content

Conversation

@AndreiNepsha
Copy link
Contributor

No description provided.

return nil
end

local started = fiber.time64()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think time64 is redundant, and I prefer to use fiber.time().

timeout = timeout * 1000000

while true do
local tube_size = self.space:count()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.space:len() is more preferable here, because it is faster, but has less precision.

-- put task in space
local put = function (self, data, opts)
local timeout = opts.timeout or 0
timeout = timeout * 1000000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If fiber.time64() will be changed on fiber.time(), then this multiplication will be not needed.

end

local started = fiber.time64()
fiber.yield()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fiber.yield() may cause a big cpu load, so I prefer to use fiber.sleep(0.01)

@Kasen Kasen merged commit e75c3bf into tarantool:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants