daml/ledger-api
Samir Talwar 7f679b9896
resources: Customizable contexts. (#7678)
* resources: Move builders into //ledger/ledger-resources.

Keep the actual constructors in a trait, but instantiate it when working
with ledger code.

This allows us to later introduce an extra "context" type parameter to
ResourceOwner.

* resources-akka: Move the builders in to //ledger/ledger-resources.

* resources: Introduce an abstract `Context` parameter for owners.

This replaces the concrete `ExecutionContext`. While it _can_ be an
execution context, it really doesn't matter as long as we can get at one
somehow.

This is being introduced so we can wrap the context in a container,
either for type tagging or to include extra information.

Because our current context _is_ `ExecutionContext`, and an implicit is
provided to extract it, we can end up with two ways to get the same
value. We use shadowing to prevent this. This problem should go away in
the near future when a new context type is added.

CHANGELOG_BEGIN
- [Integration Kit] The `ResourceOwner` type is now parameterized by a
  `Context`, which is filled in by the corresponding `Context` class in
  the _ledger-resources_ dependency. This allows us to pass extra
  information through resource acquisition.
CHANGELOG_END

* ledger-resources: Move `ResourceOwner` here from `resources`.

* ledger-resources: Remove dependencies from outside //ledger.

* ledger-resource: Wrap the acquisition execution context in `Context`.

So we can add a logging context to it.

* resources: Pass the Context, not the ExecutionContext, to Resource.

* Avoid importing `HasExecutionContext`.

* ledger-resources: Publish to Maven Central.

* resources: Make the small changes suggested by @stefanobaghino-da.

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* ledger-resources: Pull out a trait for test resource contexts.

Saves a few lines of code.

* Restore some imports that were accidentally wildcarded.

* resources: Replace an `implicit def` with a couple of imports.

* participant-integration-api: Simplify the JdbcLedgerDaoBackend tests.

Try and use the right execution context where possible.

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-10-20 09:26:28 +00:00
..
grpc-definitions Remove vendored pkg_tar (#6934) 2020-07-30 15:53:16 +00:00
perf-testing disable warts.Any and remove most suppressions (#6132) 2020-05-28 16:53:41 +00:00
rs-grpc-akka Ledger: revert time change from #7430 (#7541) 2020-10-02 12:25:26 +02:00
rs-grpc-bridge rs-grpc-bridge-test-lib: remove unneeded deps (#7435) 2020-09-18 13:25:05 +02:00
rs-grpc-testing-utils remove unused definitions, params, args from ledger API Scala code (#6985) 2020-08-04 18:02:19 +00:00
sample-service remove unused definitions, params, args from ledger API Scala code (#6985) 2020-08-04 18:02:19 +00:00
scripts open-sourcing daml 2019-04-04 09:33:38 +01:00
testing-utils resources: Customizable contexts. (#7678) 2020-10-20 09:26:28 +00:00
.gitignore open-sourcing daml 2019-04-04 09:33:38 +01:00
.sbtopts open-sourcing daml 2019-04-04 09:33:38 +01:00
BUILD.bazel replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
README.md correct broken ledger-api-introduction links (#1565) 2019-06-07 15:18:21 -04:00
VERSION Adds VERSION file to ledger-api (#7499) 2020-09-28 12:50:11 +00:00

Ledger-API

This is the API code for the ledger, which contains:

  • gRPC API definitions
  • Generated Scala bindings
  • gRPC-RS bridge
  • gRPC-Akka bridge
  • Server API classes with validation
  • Prototype Server
  • Prototype Clients
    • Scala
    • Python
    • Node.js
  • Integration tests for all of the above

Documentation

The Ledger API Introduction contains introductory material as well as links to the protodocs reference documentation.

See the docs README for more about how to preview and publish documentation.