Skip to content

Commit

Permalink
feat(services): Services now uses join/leave instead of start/stop
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed Jun 9, 2021
1 parent eee9bdc commit 845e5f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ services.onUnavailable(service => console.log(service.id, 'is no longer availabl
// Join the network
await net.join();

// Start the services on top of the network
await services.start();
// Join the services on top of the network
await services.join();

// Register a service as a plain object
const handle = services.register({
Expand Down
4 changes: 2 additions & 2 deletions packages/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services.onServiceUnavailable(service => console.log(service.id, 'is no longer a
// Join the network
await net.join();

// Start the services on top of the network
await services.start();
// Join the services layer on top of the network
await services.join();

// Register a service as a plain object
const handle = services.register({
Expand Down
8 changes: 4 additions & 4 deletions packages/services/src/Services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,22 @@ export class Services {


/**
* Start the services allowing access to remote services.
* Join the services layer allowing access to remote services.
*
* @returns
* promise that resolves when services have started
*/
public start(): Promise<void> {
public join(): Promise<void> {
return this.exchange.join();
}

/**
* Stop the services no longer allowing access to remote services.
* Leave the services no longer allowing access to remote services.
*
* @returns
* promise that resolves when services have stopped
*/
public stop(): Promise<void> {
public leave(): Promise<void> {
return this.exchange.leave();
}

Expand Down

0 comments on commit 845e5f5

Please sign in to comment.