forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvutils|ledger: Don't use Scala's global execution context. (digital-…
…asset#4374) * kvutils|ledger: Don't use Scala's global execution context. I have just discovered that Scala's global execution context uses daemon threads, which means they don't stick around past the end of the `main` function. This is bad when application startup fails and we end up with no other threads; the application terminates before it has a chance to print the error message, which is very unhelpful. We resolve this by creating a cached thread pool in the `ProgramResource` class, specifically used for acquisition and release of resources. To do this, we need to pass the execution context through to the resource constructors, which makes usage a little more verbose, because now we can't use lambda functions (which can't take implicit arguments such as the `executionContext`). CHANGELOG_BEGIN CHANGELOG_END * kvutils-app|reference-v2: Sort `Runner` and `ReferenceServer` methods.
- Loading branch information
1 parent
fcab7d1
commit 1df292c
Showing
8 changed files
with
145 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.