-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add list functionality to various clients
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
Showing
5 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |