Skip to main content

alien_worker_protocol/
lib.rs

1//! The Worker app protocol between `alien-worker-runtime` and a Worker
2//! application: task delivery, lifecycle, and `waitUntil` draining.
3//!
4//! Generated clients and message types are always available. The Worker runtime
5//! enables the `server` feature to host the Control and WaitUntil services.
6
7/// Generated Control service client, server stub, and message types.
8pub mod batch;
9
10pub mod control {
11    tonic::include_proto!("alien_worker.control");
12
13    #[cfg(feature = "server")]
14    pub(crate) const FILE_DESCRIPTOR_SET: &[u8] =
15        tonic::include_file_descriptor_set!("alien_worker.control_descriptor");
16}
17
18/// Generated WaitUntil service client, server stub, and message types.
19pub mod wait_until {
20    tonic::include_proto!("alien_worker.wait_until");
21
22    #[cfg(feature = "server")]
23    pub(crate) const FILE_DESCRIPTOR_SET: &[u8] =
24        tonic::include_file_descriptor_set!("alien_worker.wait_until_descriptor");
25}
26
27#[cfg(feature = "server")]
28mod control_service;
29#[cfg(feature = "server")]
30pub mod error;
31#[cfg(feature = "server")]
32mod server;
33#[cfg(feature = "server")]
34mod wait_until_service;
35
36#[cfg(feature = "server")]
37pub use control_service::ControlGrpcServer;
38#[cfg(feature = "server")]
39pub use server::{run_grpc_server, GrpcServerHandles};
40#[cfg(feature = "server")]
41pub use wait_until_service::WaitUntilGrpcServer;
42
43#[cfg(feature = "server")]
44pub(crate) const MAX_GRPC_MESSAGE_SIZE: usize = 4 * 1024 * 1024 * 1024; // 4GB