-
Notifications
You must be signed in to change notification settings - Fork 3
Dequeuing
Jef King edited this page Apr 16, 2016
·
20 revisions
There are several ways to achieve dequeuing; but I would suggest looking at the Dequeue Factory. This creates the queue, and then maintains dynamic frequency, batch sizing and number of threads polling.
By using the factory, you are able to specify dynamic characteristics of the dequeuing; see the table below to understand the aspects of each priority.
Low | Medium | High | Definition | |
---|---|---|---|---|
Throughput | 0.7-12.8 | 2.1-102 | 25.6-800 | ~ msgs per second (per task) |
Cost | <= $0.03 | $0.01-$0.10 | $0.05-0.64 | ~ cost per month (per task) |
public class Factory : ITaskFactory<Configuration>
{
public IEnumerable<IRunnable> Tasks(Configuration config)
{
var f = new DequeueFactory("Connection String");
return f.Dequeue<CompanyProcessor, CompanyModel>("queue-name", QueuePriority.Medium);
}
}
public class Factory : ITaskFactory<Configuration>
{
public IEnumerable<IRunnable> Tasks(Configuration config)
{
var f = new DequeueFactory("Connection String");
return f.Shards<CompanyProcessor, CompanyModel>("queue-name", 10);
}
}