Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTS API: write an idiomatic "Hello WAMP" #474

Closed
oberstet opened this issue Sep 1, 2015 · 3 comments
Closed

LTS API: write an idiomatic "Hello WAMP" #474

oberstet opened this issue Sep 1, 2015 · 3 comments

Comments

@oberstet
Copy link
Contributor

oberstet commented Sep 1, 2015

No description provided.

@oberstet
Copy link
Contributor Author

oberstet commented Sep 1, 2015

a first step towards #472

@oberstet
Copy link
Contributor Author

How would a modern API for Python 3.5+ using async/await etc look like? What would be expected / least surprising / feel natural?

I have gone back to the drawing table starting from above assumption. I'll post here.

CALLER:

import asyncio
from autobahn.asyncio import wamp

url = 'ws://localhost:8080/ws'
realm = 'realm1'

async def go():
    async with wamp.connect(url) as transport:
        async with transport.join(realm) as session:
            result = await session.call('com.example.add2', 2, 3)
            print(result)

loop = asyncio.get_event_loop()
loop.run_until_complete(go())

@oberstet oberstet removed this from the 0.11.0 milestone Mar 18, 2017
@oberstet
Copy link
Contributor Author

subseded/fixed in #964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants