Skip to content
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

Releasing system resources #427

Open
jclark opened this issue Feb 22, 2020 · 2 comments
Open

Releasing system resources #427

jclark opened this issue Feb 22, 2020 · 2 comments
Assignees
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design
Milestone

Comments

@jclark
Copy link
Collaborator

jclark commented Feb 22, 2020

Many languages provide features to help with releasing system resources, such as open file handles. For example, C# has the using statement which works with IDisposable interface. Go has the defer keyword. Java has a try-with-resources statement that works with the AutoCloseable interface.

One key area in Ballerina which could take advantage of this is the SQL connections and streams.

@jclark jclark added design/implementability Difficulty implementing the design design/dislike Do not like something about the design Type/Improvement Enhancement to language design Area/Lang Relates to the Ballerina language specification and removed design/dislike Do not like something about the design design/implementability Difficulty implementing the design labels Feb 22, 2020
@jclark jclark self-assigned this Feb 22, 2020
@jclark jclark added this to the 2020R2 milestone Feb 24, 2020
@jclark
Copy link
Collaborator Author

jclark commented Feb 24, 2020

This is related to #334, but not quite the same.

@jclark
Copy link
Collaborator Author

jclark commented Feb 29, 2020

One important design issue is whether the method that gets calls (i.e. our equivalent of IDisposable or AutoCloseable) can return an error. I suspect it needs to, and then it will automatically do a check on that.

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
Projects
None yet
Development

No branches or pull requests

1 participant