Skip to content

Commit

Permalink
Add list functionality to various clients
Browse files Browse the repository at this point in the history
This commit introduces list functionality that fetches 'channels' from different clients such as EventsStoreClient, EventsClient, QueuesClient, QueriesClient, and CommandsClient. Each client is set-up with a configuration, and an asynchronous list function that queries and logs the 'channels'.
  • Loading branch information
liornabat committed Apr 25, 2024
1 parent 83dab83 commit ee70ab1
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/pubsub/events/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Config, Utils, EventsClient } from '../../../src';

const opts: Config = {
address: 'localhost:50000',
clientId: Utils.uuid(),
reconnectInterval: 1000,
};
const eventsClient = new EventsClient(opts);
async function list(search: string) {
const channels = await eventsClient.list(search);
console.log(channels);
}

async function main() {
await list('e1');
// wait for receiver
}
main();
18 changes: 18 additions & 0 deletions examples/pubsub/events_store/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Config, Utils, EventsStoreClient } from '../../../src';

const opts: Config = {
address: 'localhost:50000',
clientId: Utils.uuid(),
reconnectInterval: 1000,
};
const eventsStoreClient = new EventsStoreClient(opts);
async function list(search: string) {
const channels = await eventsStoreClient.list(search);
console.log(channels);
}

async function main() {
await list('');
// wait for receiver
}
main();
18 changes: 18 additions & 0 deletions examples/queues/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Config, Utils, QueuesClient } from '../../src';

const opts: Config = {
address: 'localhost:50000',
clientId: Utils.uuid(),
reconnectInterval: 1000,
};
const queuesClient = new QueuesClient(opts);
async function list(search: string) {
const channels = await queuesClient.list(search);
console.log(channels);
}

async function main() {
await list('');
// wait for receiver
}
main();
18 changes: 18 additions & 0 deletions examples/rpc/commnds/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Config, Utils, CommandsClient } from '../../../src';

const opts: Config = {
address: 'localhost:50000',
clientId: Utils.uuid(),
reconnectInterval: 1000,
};
const commandsClient = new CommandsClient(opts);
async function list(search: string) {
const channels = await commandsClient.list(search);
console.log(channels);
}

async function main() {
await list('');
// wait for receiver
}
main();
18 changes: 18 additions & 0 deletions examples/rpc/queries/list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Config, Utils, QueriesClient } from '../../../src';

const opts: Config = {
address: 'localhost:50000',
clientId: Utils.uuid(),
reconnectInterval: 1000,
};
const queriesClient = new QueriesClient(opts);
async function list(search: string) {
const channels = await queriesClient.list(search);
console.log(channels);
}

async function main() {
await list('');
// wait for receiver
}
main();

0 comments on commit ee70ab1

Please sign in to comment.