<commit_before>package io.scalecube.services.examples.helloworld;

import io.scalecube.services.Microservices;
import io.scalecube.services.discovery.ScalecubeServiceDiscovery;
import io.scalecube.services.examples.ServiceTransports;
import io.scalecube.services.examples.helloworld.service.GreetingServiceImpl;
import io.scalecube.services.examples.helloworld.service.api.GreetingsService;
import io.scalecube.services.gateway.http.HttpGateway;
import io.scalecube.services.gateway.ws.WebsocketGateway;
import io.scalecube.transport.Address;

public class GatewayExample {

  /**
   * Example running gateway service (ws,http) and provisioning greeting service.
   *
   * @param args none needed.
   * @throws InterruptedException joining main thread.
   */
  public static void main(String[] args) {
    // 1. ScaleCube Node node with no members
    Microservices gateway =
        Microservices.builder()
            .discovery(serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint))
            .transport(ServiceTransports::rsocketServiceTransport)
            // expose http(8080) and websocket(8181) via corresponding gateways:
            .gateway(opt -> new WebsocketGateway(opt.id("ws").port(8080)))
            .gateway(opt -> new HttpGateway(opt.id("http").port(8181)).corsEnabled(true))
            .startAwait();

    Address seedAddress =
        Address.create(gateway.discovery().address().host(), gateway.discovery().address().port());

    // 2. Construct a ScaleCube node which joins the cluster hosting the Greeting Service
    Microservices ms =
        Microservices.builder()
            .discovery(
                serviceEndpoint ->
                    new ScalecubeServiceDiscovery(serviceEndpoint)
                        .options(opts -> opts.seedMembers(seedAddress)))
            .transport(ServiceTransports::rsocketServiceTransport)
            .services(new GreetingServiceImpl())
            .startAwait();

    // 3. Create service proxy
    GreetingsService service = gateway.call().api(GreetingsService.class);

    // Execute the services and subscribe to service events
    service
        .sayHello("joe")
        .subscribe(
            consumer -> {
              System.out.println(consumer.message());
            });

    gateway.onShutdown().block();
    ms.onShutdown().block();
  }
}
<commit_msg>fix javadoc<commit_after>package io.scalecube.services.examples.helloworld;

import io.scalecube.services.Microservices;
import io.scalecube.services.discovery.ScalecubeServiceDiscovery;
import io.scalecube.services.examples.ServiceTransports;
import io.scalecube.services.examples.helloworld.service.GreetingServiceImpl;
import io.scalecube.services.examples.helloworld.service.api.GreetingsService;
import io.scalecube.services.gateway.http.HttpGateway;
import io.scalecube.services.gateway.ws.WebsocketGateway;
import io.scalecube.transport.Address;

public class GatewayExample {

  /**
   * Example running gateway service (ws,http) and provisioning greeting service.
   *
   * @param args none needed.
   */
  public static void main(String[] args) {
    // 1. ScaleCube Node node with no members
    Microservices gateway =
        Microservices.builder()
            .discovery(serviceEndpoint -> new ScalecubeServiceDiscovery(serviceEndpoint))
            .transport(ServiceTransports::rsocketServiceTransport)
            // expose http(8080) and websocket(8181) via corresponding gateways:
            .gateway(opt -> new WebsocketGateway(opt.id("ws").port(8080)))
            .gateway(opt -> new HttpGateway(opt.id("http").port(8181)).corsEnabled(true))
            .startAwait();

    Address seedAddress =
        Address.create(gateway.discovery().address().host(), gateway.discovery().address().port());

    // 2. Construct a ScaleCube node which joins the cluster hosting the Greeting Service
    Microservices ms =
        Microservices.builder()
            .discovery(
                serviceEndpoint ->
                    new ScalecubeServiceDiscovery(serviceEndpoint)
                        .options(opts -> opts.seedMembers(seedAddress)))
            .transport(ServiceTransports::rsocketServiceTransport)
            .services(new GreetingServiceImpl())
            .startAwait();

    // 3. Create service proxy
    GreetingsService service = gateway.call().api(GreetingsService.class);

    // Execute the services and subscribe to service events
    service
        .sayHello("joe")
        .subscribe(
            consumer -> {
              System.out.println(consumer.message());
            });

    gateway.onShutdown().block();
    ms.onShutdown().block();
  }
}

{'fraction_non_alphanumeric': 0.10414920368818105, 'fraction_numerical': 0.00796311818943839, 'mean_word_length': 2.7376664056382145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2566824', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1247, 'n_words': 244}