-
Notifications
You must be signed in to change notification settings - Fork 28
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
Implements asyncio support for nirum compiler #164
Conversation
@@ -890,8 +905,8 @@ class {className}_Client($className): | |||
et <- compileTypeExpression src errorTypeExpression | |||
return $ Just [qq|('{toAttributeName' mn}', $et)|] | |||
Nothing -> return Nothing | |||
compileMethod :: Method -> CodeGen Code | |||
compileMethod m@(Method mName params rtype _etype _anno) = do | |||
compileMethod :: Bool -> Method -> CodeGen Code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bool
을 그대로 쓰기보다는 async 여부를 나타낼 수 있는 새로운 타입을 정의하는 것을 추천합니다.
name = "nirum" | ||
email = "dev@nirum.org" | ||
|
||
[targets] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 줄은 불필요합니다.
service pong-service ( | ||
bool pong (), | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 여백은 불필요합니다.
|
||
|
||
def test_async_disabled(): | ||
service = PingService_Async() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support_async = false
인 경우엔 아예 PingService_Async
가 생성되지 않아야 하지 않을까 생각합니다. 어차피 생성된다고 해도 진짜 async 버전과 서로 인터페이스가 호환되지도 않을 테고요.
Python 3.4 does not supports |
7d5a611
to
12a5ff2
Compare
It's 2018 — I think Python 3.4 support could be dropped since aiohttp now supports only Python 3.5.3+ and major Linux distros come with Python 3.5+ now. |
Supporting asyncio is configurable with
support_async
flag inpackage.toml
.To implement this option, I implemented boolean field handling in
Package/metadata.hs
.If the
support_async
flag is set totrue
, my nirum fork creates another service module{className}_Async
and putasync def
keyword to methods, instead ofdef
keywords.To implement tox unit tests, I created another fixture in
test/nirum_fixture_async
. It just contains a service with onebool
field.