-
Notifications
You must be signed in to change notification settings - Fork 55
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
Proper service type descriptor #329
Labels
Area/Lang
Relates to the Ballerina language specification
Type/Improvement
Enhancement to language design
Comments
riyafa
added
design/usability
Design does not work well for some tasks
Area/Platform
Relates to the Ballerina platform
spec/improve
Something that should be improved in the spec
status/discuss
Needs discussion outside github comments
labels
Sep 4, 2019
jclark
added
Type/Improvement
Enhancement to language design
Area/Lang
Relates to the Ballerina language specification
and removed
design/usability
Design does not work well for some tasks
Area/Platform
Relates to the Ballerina platform
status/discuss
Needs discussion outside github comments
spec/improve
Something that should be improved in the spec
labels
Sep 4, 2019
This is definitely on our radar. Until gets this added to the language, the idea is that you can annotate the service type.
You then treat the abstract type |
jclark
changed the title
Support service typing
Provide more precise typing of services
Nov 20, 2019
jclark
changed the title
Provide more precise typing of services
Proper service type descriptor
Jun 30, 2020
This was referenced Jun 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area/Lang
Relates to the Ballerina language specification
Type/Improvement
Enhancement to language design
Description:
Currently all the services are of the generic type
service
and hence the__attach
life cycle function of all the listeners take the same service. This has caused complications in differentiating services when the same listener supports two different service types (Eg.http:Listener
supports both WebSocket and http services.) In this case it is difficult to have proper compiler validations. Although we have certain hacks in the compiler plugin that uses the resource parameters to validate the service, these are not proper solutions as we get odd compiler messages at certain times.Also compile time validations are complicated when defining the service as a separate variable. In this case also resource parameters are used for compiler validation which is not particularly useful in all instances. One example is here.
This also causes issues in tooling code generation because, the tooling also need to depend on the listener or other means to generate code snippets.
Related mail thread though a little outdated: https://groups.google.com/d/msg/ballerina-dev/AicMMCXL8kA/w9l1vNz1CAAJ
Code sample that shows issue:
Attaching two services to same listener:
Defining service as a different variable:
https://gist.github.com/riyafa/3f0b31ce53a75911d7ef1bc00ff43b83
Related Issues:
ballerina-platform/ballerina-lang#14148
The text was updated successfully, but these errors were encountered: