Current collected state Current
Observed since 21 Oct, 11:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Simple RPC server/client framework.
import aiochat
import aiohttp.web
class Agent(aiochat.ServerAgent):
@aiochat.use
async def join(self, *args, delimit = ','):
return delimit.join(map(str, args))
app = aiohttp.web.Application()
routes = aiohttp.web.RouteTableDef()
@routes.get('/connect')
async def handle(request):
websocket = aiohttp.web.WebSocketResponse()
await websocket.prepare(request)
agent = Agent()
await agent.start(websocket)
value = 'eggs and bacon and salad'
# remote call
result = await agent.split(value, delimit = ' and ')
print('result:', result)
# wait until disconnection
await agent.wait()
return websocket
app.router.add_routes(routes)
aiohttp.web.run_app(app)
import aiochat
import aiohttp
import asyncio
class Agent(aiochat.ClientAgent):
@aiochat.use
async def split(self, value, delimit = ','):
return value.split(delimit)
loop = asyncio.get_event_loop()
url = 'http://localhost:8080/connect'
async def main():
session = aiohttp.ClientSession(loop = loop)
async def connect():
while not session.closed:
try:
websocket = await session.ws_connect(url)
except aiohttp.ClientError:
await asyncio.sleep(0.5)
else:
break
return websocket
agent = Agent(connect)
await agent.start()
values = ('crooked man', 'mile', 'sixpence', 'stile')
# remote call
result = await agent.join(*values, delimit = ' ')
print('result:', result)
# disconnect
await agent.stop()
await session.close()
coroutine = main()
loop.run_until_complete(coroutine)
hello alert methods.bind wait start stop methods.python3 -m pip install aiochat
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.3 | 28 Jan 2020 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:0968bec2717903c83e57426ddb9ccd703f382d60a4d182f7d61cad00bcecd657