Services.Signal

This example demonstrates the various ways that a signal can be recorded against a service in the execution of a local activity.

  private static void execute () {

    final Context context =
      Services.context ();

    final Service local =
      context
        .service (
          Services.name (
            "service"
          ).name (
            "one"
          )
        );

    Services
      .execute (
        local,
        () -> {
        }
      );

    local
      .start ()
      .succeed ()
      .stop ();

    local
      .start ( EMIT )
      .succeed ( EMIT )
      .stop ( EMIT );

    local
      .emit (
        START
      );
    local
      .emit (
        SUCCEED,
        STOP
      );

    local
      .signal (
        EMIT,
        START
      );
    local
      .signal (
        EMIT,
        SUCCEED,
        STOP
      );

  }

This example demonstrates the various ways that a signal can be recorded against a service in the calling of a remote execution.

  private static void call () {

    final Context context =
      Services.context ();

    final Service remote =
      context
        .service (
          Services.name (
            "service"
          ).name (
            "one"
          )
        );

    Services
      .call (
        remote,
        () -> {
        }
      );

    remote
      .call ()
      .succeeded ();

    remote
      .call ( EMIT )
      .succeed ( RECEIPT );

    remote
      .emit (
        CALL
      );
    remote
      .receipt (
        SUCCEED
      );

    remote
      .signal (
        EMIT,
        CALL
      );
    remote
      .signal (
        RECEIPT,
        SUCCEED
      );

  }