You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/03 16:16:57 UTC

[GitHub] [beam] kennknowles opened a new issue, #18083: Simple pattern for per-bundle and per-DoFn Closeable resources

kennknowles opened a new issue, #18083:
URL: https://github.com/apache/beam/issues/18083

   Dealing with Closeable resources inside a processElement call is easy: simply use try-with-resources.
   
   However, bundle- or DoFn-scoped resources, such as long-lived database connections, are less convenient to deal with: you have to open them in startBundle and conditionally close in finishBundle (likewise setup/teardown), taking special care if there's multiple resources to close all of them.
   
   Perhaps we should provide something like Guava's Closer to DoFn's https://github.com/google/guava/wiki/ClosingResourcesExplained. Ideally, the user would need to only write a startBundle() or setup() method, but not write finishBundle() or teardown() - resources would be closed automatically.
   
   Imported from Jira [BEAM-702](https://issues.apache.org/jira/browse/BEAM-702). Original Jira may contain additional context.
   Reported by: jkff.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org