معرفی شرکت ها


aiothrift-0.2.7


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Async Thrift server and client
ویژگی مقدار
سیستم عامل -
نام فایل aiothrift-0.2.7
نام aiothrift
نسخه کتابخانه 0.2.7
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Ryan Wang
ایمیل نویسنده hwwangwang@gmail.com
آدرس صفحه اصلی http://github.com/moonshadow/aiothrift/
آدرس اینترنتی https://pypi.org/project/aiothrift/
مجوز MIT
aiothrift ========= Asyncio implementation for thrift protocol, which is heavily based on thriftpy2_. .. image:: https://travis-ci.org/ryanwang520/aiothrift.svg?branch=master :target: https://travis-ci.org/ryanwang520/aiothrift Documentation: https://aiothrift.readthedocs.org/ Installation ------------ :: $ pip install aiothrift Usage example ------------- Thrift file ^^^^^^^^^^^ :: service PingPong { string ping(), i64 add(1:i32 a, 2:i64 b), } Server ^^^^^^ .. code:: python import asyncio import aiothrift pingpong_thrift = aiothrift.load('pingpong.thrift', module_name='pingpong_thrift') class Dispatcher: def ping(self): return "pong" async def add(self, a, b): await asyncio.sleep(1) return a + b async def main(): server = await aiothrift.create_server(pingpong_thrift.PingPong, Dispatcher())) async with server: await server.serve_forever() asyncio.run(main()) Client ^^^^^^ .. code:: python import asyncio import aiothrift pingpong_thrift = aiothrift.load('pingpong.thrift', module_name='pingpong_thrift') async def go(): conn = await aiothrift.create_connection(pingpong_thrift.PingPong) print(await conn.ping()) print(await conn.add(5, 6)) conn.close() asyncio.run(go()) Or use ConnectionPool ^^^^^^^^^^^^^^^^^^^^^ .. code:: python import asyncio import aiothrift pingpong_thrift = aiothrift.load('pingpong.thrift', module_name='pingpong_thrift') async def go(): client = await aiothrift.create_pool(pingpong_thrift.PingPong) print(await client.ping()) print(await client.add(5, 6)) client.close() await client.wait_closed() asyncio.run(go()) It's just that simple to begin with ``aiothrift``, and you are not forced to use ``aiothrift`` on both server and client side. So if you already have a normal thrift server setup, feel free to create an async thrift client to communicate with that server. Requirements ------------ - Python >= 3.7.0 - async-timeout_ - thriftpy2_ .. _async-timeout: https://pypi.python.org/pypi/async_timeout .. _thriftpy2: https://thriftpy2.readthedocs.org/en/latest/ LICENSE ------- ``aiothrift`` is offered under the MIT license.


نیازمندی

مقدار نام
>=3.0.1,<5.0.0 async-timeout
>=0.4.9,<0.5.0 thriftpy2


زبان مورد نیاز

مقدار نام
>=3.7,<4.0 Python


نحوه نصب


نصب پکیج whl aiothrift-0.2.7:

    pip install aiothrift-0.2.7.whl


نصب پکیج tar.gz aiothrift-0.2.7:

    pip install aiothrift-0.2.7.tar.gz