classtranscribe / classtranscribe/WebAPI
Use one RabbitMQ connection + use co-routines
- Dominant language
- C#
- Stars
- 16
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
TODO: TaskEngine should use one RabbitMQ connection for the whole process not one per task
TODO: Take a deep dive into how this actually working and document it.
It would also be useful to confirm that we are actually using async co-routines and not multiple threads.
TaskEngine does not explicilty create any threads; however it certainly has a main loop that sleeps for a couple of hours, while mulitple message queues are being concurrently services!
We may need to upgrade to the latest RabbitMQ C# client.
And emperically confirm that RabbitMQ C# Implementation with a prefetch count>1 does not implement concurrency using multiple threads.
e.g. alway print out a threadID and print out how many threads are running
e.g. take a deep dive into the C# RabbitMQ source code.
https://github.com/classtranscribe/WebAPI/blob/e53313c60e95098a309c107d26561443407f610b/CTCommons/RabbitMQ/RabbitMQConnection.cs#L129
_logger.LogInformation("Prefetch concurrency count {0}" , concurrency);
_channel.QueueDeclare(.... );
_channel.BasicQos(prefetchSize: 0, prefetchCount: concurrency, global: false);
}
var consumer = new EventingBasicConsumer(_channel);
consumer.Received += async (model, ea) =>
{ ...
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.