Tarantool connection driver for work with asyncio
Project description
Connector required tarantool version 1.6:
$ pip install aiotarantool
Also, you need to install experimental branch tarantool-python for python 3.4:
$ pip install git+https://github.com/shveenkov/tarantool-python.git@for_python3.4
Try it example:
import asyncio
import aiotarantool
cnt = 0
@asyncio.coroutine
def insert_job(tnt):
global cnt
for it in range(2500):
cnt += 1
r = yield from tnt.insert("tester", (cnt, cnt))
loop = asyncio.get_event_loop()
tnt = aiotarantool.connect("127.0.0.1", 3301)
tasks = [asyncio.async(insert_job(tnt))
for _ in range(40)]
loop.run_until_complete(asyncio.wait(tasks))
loop.run_until_complete(tnt.close())
loop.close()
Under this scheme the aiotarantool driver makes a smaller number of read/write tarantool socket.
See benchmark results time for insert/select/delete 100K tuples on 1.5KBytes:
call |
tarantool |
aiotarantool |
---|---|---|
insert |
35.938047 |
12.701088 |
select |
24.389748 |
12.746204 |
delete |
35.224515 |
13.905095 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiotarantool-1.0.4.tar.gz
(5.0 kB
view details)
File details
Details for the file aiotarantool-1.0.4.tar.gz
.
File metadata
- Download URL: aiotarantool-1.0.4.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c1db6354545239abaf54a4f0f81bfafd86ac8eb7786ae063d2c9d43371b17e7 |
|
MD5 | c6f94cedf9643ea611ccff1e2ea64f3c |
|
BLAKE2b-256 | f4f04dd3e32c64fa46de2cb5558a94e0bfbecc8f7b2dabf38e25abb32d2b1c71 |