Using dart rpc can you label a API method as "async"? I see in the documentation you can return a future, but when I try to label the method async it seems to create a lot of problems.
Asked
Active
Viewed 130 times
0
-
1Can you show us some code? If you can return a Future, you can surely make it async. – Pacane Jun 28 '16 at 15:27
-
My guess is that you're trying to do something, and async is not working as you expect it to work. – Pacane Jun 28 '16 at 15:27
-
Not sure what you're looking for it's just an APIMethod labeled as 'async' like "Future
add(Item i) async". I had thought the same thing that surely it would work until I realized none of RPC's examples have API methods labeled as async. – BeatingToADifferentRobot Jun 28 '16 at 15:30 -
When it's labeled as async I get a "bad parameter error", but I'm passing in the exact type. – BeatingToADifferentRobot Jun 28 '16 at 15:30
-
Please post some code that demonstrates what you are doing. – Günter Zöchbauer Jun 28 '16 at 15:34
-
I think the question is more straightforward without code. Can you use the async label on an API Method in dart rpc? It's a simple yes or no. I cannot find an example where the answer is yes. – BeatingToADifferentRobot Jun 28 '16 at 15:44
-
https://github.com/dart-lang/rpc/issues/29. It appears async is not supported. – BeatingToADifferentRobot Jun 28 '16 at 15:50
-
What do you mean not supported -- https://github.com/dart-lang/rpc/issues/29#issuecomment-229117660 – Pacane Jun 28 '16 at 18:19
-
It is supported. i was able to create a test case. It's odd the rpc documents don't include the use of async. – BeatingToADifferentRobot Jun 29 '16 at 05:36
2 Answers
0
Async is supported. Thanks to the support on this thread. https://github.com/dart-lang/rpc/issues/29

BeatingToADifferentRobot
- 394
- 3
- 17