Skip to content

Commit

Permalink
Simplifying discovery and joining methods
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Nov 30, 2024
1 parent 687d77e commit 52f01ef
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 145 deletions.
4 changes: 4 additions & 0 deletions examples/src/common-join-leave-rejoin-example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export async function run() {

logger.info('We remove server1Acceptor from server_2 and server_3 and see if rejoin event is triggered');

logger.info('Waiting for rejoining event');

await Promise.all([
new Promise<void>(resolve => server_1.once('rejoining', () => (logger.info('Server_1 rejoin'), resolve()))),
Promise.resolve(server_2.off('message', server1Acceptor)),
Expand All @@ -115,6 +117,8 @@ export async function run() {

logger.info('We add server1Acceptor to server_2 and server_3 and see if joined event is triggered');

logger.info('Waiting for joined event');

await Promise.all([
new Promise<void>(resolve => server_1.once('joined', () => (logger.info('Server_1 joined'), resolve()))),
Promise.resolve(server_2.on('message', server1Acceptor)),
Expand Down
1 change: 0 additions & 1 deletion examples/src/run-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { run as recordEvents } from './record-events-example';
import { run as recordDynamicCreating } from './record-dynamic-creating-example';
import { run as emitterExample } from './emitter-example';
import { run as emitterCatchup } from './emitter-catchup-example';
import { run as reelectionExample } from './common-reelection-example';
import { run as queueEvents } from './queue-events-example';
import { run as queuePushPop } from './queue-push-pop-example';
import { run as queueCatchingUp } from './queue-catching-up-example';
Expand Down
Loading

0 comments on commit 52f01ef

Please sign in to comment.