15 lines
472 B
TypeScript
15 lines
472 B
TypeScript
|
|
import { RabbitManagementClient } from "../infrastructure/RabbitManagementClient.js";
|
||
|
|
import { Queue } from "../domain/Queue.js";
|
||
|
|
|
||
|
|
export class RabbitUseCases {
|
||
|
|
private client: RabbitManagementClient
|
||
|
|
|
||
|
|
constructor(client: RabbitManagementClient) {
|
||
|
|
this.client = client
|
||
|
|
}
|
||
|
|
|
||
|
|
public async getQueuesStatus(): Promise<Queue[]> {
|
||
|
|
const queues = await this.client.getQueues()
|
||
|
|
return queues.sort((a, b) => b.messages - a.messages)
|
||
|
|
}
|
||
|
|
}
|