File: await.py

package info (click to toggle)
python-rx 4.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,056 kB
  • sloc: python: 39,070; javascript: 77; makefile: 24
file content (16 lines) | stat: -rw-r--r-- 293 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import asyncio

import reactivex

stream = reactivex.just("Hello, world!")


async def hello_world():
    n = await stream
    print(n)


loop = asyncio.get_event_loop()
# Blocking call which returns when the hello_world() coroutine is done
loop.run_until_complete(hello_world())
loop.close()