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 control {
9    tonic::include_proto!("alien_worker.control");
10
11    #[cfg(feature = "server")]
12    pub(crate) const FILE_DESCRIPTOR_SET: &[u8] =
13        tonic::include_file_descriptor_set!("alien_worker.control_descriptor");
14}
15
16/// Generated WaitUntil service client, server stub, and message types.
17pub mod wait_until {
18    tonic::include_proto!("alien_worker.wait_until");
19
20    #[cfg(feature = "server")]
21    pub(crate) const FILE_DESCRIPTOR_SET: &[u8] =
22        tonic::include_file_descriptor_set!("alien_worker.wait_until_descriptor");
23}
24
25#[cfg(feature = "server")]
26mod control_service;
27#[cfg(feature = "server")]
28pub mod error;
29#[cfg(feature = "server")]
30mod server;
31#[cfg(feature = "server")]
32mod wait_until_service;
33
34#[cfg(feature = "server")]
35pub use control_service::ControlGrpcServer;
36#[cfg(feature = "server")]
37pub use server::{run_grpc_server, GrpcServerHandles};
38#[cfg(feature = "server")]
39pub use wait_until_service::WaitUntilGrpcServer;
40
41#[cfg(feature = "server")]
42pub(crate) const MAX_GRPC_MESSAGE_SIZE: usize = 4 * 1024 * 1024 * 1024; // 4GB