Skip to content

Commit

Permalink
Update README.md (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
portlek authored Mar 11, 2024
1 parent 7b9eb60 commit 79472eb
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,37 @@ dependencies {
```
```java
void agones() {
final ExecutorService gameServerWatcherExecutor =
Executors.newSingleThreadExecutor();
final ScheduledExecutorService healthCheckExecutor =
Executors.newSingleThreadScheduledExecutor();
final Agones agones = Agones.builder()
// Address specification.
// If not specified, localhost:9357 will be used.
// All the following methods are creating a ManagedChannel with 'usePlaintext'
// If you need to use SSL, you can use 'withChannel(ManagedChannel)' method.
.withAddress("localhost", 9357)
.withAddress("localhost") // 9357
.withAddress(9357) // localhost
.withAddress() // localhost 9357
.withTarget("localhost:9357")
.withTarget() // localhost:9357
.withChannel(ManagedChannelBuilder
.forAddress("localhost", 9357)
.usePlaintext()
.build())
.withChannel() // localhost:9357
// Game server watcher executor specification.
.withGameServerWatcherExecutor(gameServerWatcherExecutor)
// Health checker executor specification.
// Check you game server's health check threshold and
// set the executor's delay and period accordingly.
.withHealthCheck(
/* delay */Duration.ofSeconds(1L),
/* period */Duration.ofSeconds(2L)
)
.withHealthCheckerExecutor(healthCheckExecutor)
.build();
final ExecutorService gameServerWatcherExecutor =
Executors.newSingleThreadExecutor();
final ScheduledExecutorService healthCheckExecutor =
Executors.newSingleThreadScheduledExecutor();
final Agones agones = Agones.builder()
// Address specification.
// If not specified, localhost:9357 will be used.
// All the following methods are creating a ManagedChannel with 'usePlaintext'
// If you need to use SSL, you can use 'withChannel(ManagedChannel)' method.
.withAddress("localhost", 9357)
.withAddress("localhost") // 9357
.withAddress(9357) // localhost
.withAddress() // localhost 9357
.withTarget("localhost:9357")
.withTarget() // localhost:9357
.withChannel(ManagedChannelBuilder
.forAddress("localhost", 9357)
.usePlaintext()
.build())
.withChannel() // localhost:9357
// Game server watcher executor specification.
.withGameServerWatcherExecutor(gameServerWatcherExecutor)
// Health checker executor specification.
// Check you game server's health check threshold and
// set the executor's delay and period accordingly.
.withHealthCheck(
/* delay */Duration.ofSeconds(1L),
/* period */Duration.ofSeconds(2L)
)
.withHealthCheckerExecutor(healthCheckExecutor)
.build();
// Health checking.
// Checks if the executor, delay and period are specified.
if (agones.canHealthCheck()) {
Expand Down

0 comments on commit 79472eb

Please sign in to comment.