bind

open fun bind(service: Any): Endpoint.Builder

Add a Restate service to the endpoint. This will automatically discover the generated factory based on the class name.

If you want to modify some of the service definition options, such as documentation, inactivity timeout, and so on, use bind instead.

You can also manually instantiate the ServiceDefinition using bind.


open fun bind(service: Any, options: HandlerRunner.Options): Endpoint.Builder

Like bind, but allows to provide options for the handler runner. This allows to configure for the Java API the executor where to run the handler code, or the Kotlin API the coroutine context.

Look at the respective documentations of the HandlerRunner class in the Java or in the Kotlin module.

If you want to modify some of the service definition options, such as documentation, inactivity timeout, and so on, use bind instead.

See also


Same as bind but allows to configure the ServiceDefinition before binding it.


Endpoint endpoint = Endpoint
  .builder()
  .bind(
    new Counter(),
    // Configure the service
    s -> s.journalRetention(Duration.ofDays(1))
  )
  .build();

See also


Same as bind but allows to configure the before binding it.

See also


open fun bind(serviceDefinition: ServiceDefinition): Endpoint.Builder

Add a manual ServiceDefinition to the endpoint.