-
Notifications
You must be signed in to change notification settings - Fork 54
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
Is support async/await syntax in roadmap or not #74
Comments
Hi, I am not sure what exactly @gavento meant by this todo list item. However, we should implement something like your suggestion. So "await" API should go on our list explicitly. We are now both on a vacation, so I will look at it more next week.
…On 11 July 2018 11:05:16 CEST, Raymond Chen ***@***.***> wrote:
@ALL
hi all:
I have read the doc on
https://substantic.github.io/rain/docs/index.html.
The example given in `get-started` as below
```python3
from rain.client import Client, tasks, blob
# Connect to server
client = Client("localhost", 7210)
# Create a new session
with client.new_session() as session:
# Create task (and two data objects)
task = tasks.Concat((blob("Hello "), blob("world!"),))
# Mark that the output should be kept after submit
task.output.keep()
# Submit all crated tasks to server
session.submit()
# Wait for completion of task and fetch results and get it as bytes
result = task.output.fetch().get_bytes()
# Prints 'Hello world!'
print(result)
```
This is so amusing.
But `Python3.5+` support `async/await` syntax, does this project
support this syntax?
in roadmap I find this task `Update in the Python API (using aiohttp
for async API) ***@***.***) [medium]`. Is it in order to support
`async/await1 syntax?
After supporting `async/await` syntax, the example maybe shows as below
```python3
from rain.client import Client, tasks, blob
# Connect to server
client = Client("localhost", 7210)
# Create a new session
async with client.new_session() as session:
# Create task (and two data objects)
task = tasks.Concat((blob("Hello "), blob("world!"),))
# Mark that the output should be kept after submit
task.output.keep()
# Submit all crated tasks to server
session.submit()
# Wait for completion of task and fetch results and get it as bytes
result = await task.output.fetch().get_bytes()
# Prints 'Hello world!'
print(result)
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#74
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I have made a quick look on Python3 futures and I do not see how to simply combine futures and capnp promises (however it may still need only few lines of code, but I do not see deep into both). So if someone did not make combination of futures and promises, it has to wait until we did not finish removing of capnp from the client. Nevertheless, async/await API should be definitely part of our API. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ALL
hi all:
I have read the doc on https://substantic.github.io/rain/docs/index.html.
The example given in
get-started
as belowThis is so amusing.
But
Python3.5+
supportasync/await
syntax, does this project support this syntax?in roadmap I find this task
Update in the Python API (using aiohttp for async API) (@gavento) [medium]
. Is it in order to support `async/await1 syntax?After supporting
async/await
syntax, the example maybe shows as belowThe text was updated successfully, but these errors were encountered: