Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env tarantool
- box.cfg {}
- local fiber = require('fiber')
- local log = require('log')
- local mysql = require('mysql')
- local pool = mysql.pool_create({ host = '127.0.0.1', user = 'root', password = '11', db = 'tempdb', size = 5, raise = true })
- function do_smth()
- local i = 0
- while true do
- local conn = pool:get()
- log.info(tostring(i) .. ' : ping')
- conn:execute('select ?', 1)
- pool:put(conn)
- i = i + 1
- fiber.yield()
- end
- end
- for i = 1,10 do
- fiber.create(do_smth)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement