| # Copyright 2026 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| |
| load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| load("@rules_cc//cc:cc_test.bzl", "cc_test") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| cc_library( |
| name = "executor", |
| hdrs = ["executor.h"], |
| deps = [ |
| "@abseil-cpp//absl/functional:any_invocable", |
| ], |
| ) |
| |
| cc_library( |
| name = "async_context", |
| hdrs = ["async_context.h"], |
| deps = [ |
| ":cancellation_token", |
| ":executor", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/functional:any_invocable", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:statusor", |
| ], |
| ) |
| |
| cc_test( |
| name = "async_context_test", |
| srcs = ["async_context_test.cc"], |
| deps = [ |
| ":async_context", |
| ":executor", |
| "@abseil-cpp//absl/functional:any_invocable", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/status:statusor", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "cancellation_token", |
| srcs = ["cancellation_token.cc"], |
| hdrs = ["cancellation_token.h"], |
| deps = [ |
| "@abseil-cpp//absl/base:core_headers", |
| "@abseil-cpp//absl/container:flat_hash_map", |
| "@abseil-cpp//absl/functional:any_invocable", |
| "@abseil-cpp//absl/synchronization", |
| ], |
| ) |
| |
| cc_test( |
| name = "cancellation_token_test", |
| srcs = ["cancellation_token_test.cc"], |
| deps = [ |
| ":cancellation_token", |
| "@googletest//:gtest_main", |
| ], |
| ) |