Taskbroker is Sentry's distributed asynchronous task execution system. It consists of taskworkers (an application that executes tasks) and taskbrokers (an application that distributes tasks across workers).
Run make format before you commit. There are some other conventions you should follow that aren't enforced by that command, described below.
Do not nest braced groups inside other braced groups. Use only one level of nesting per use statement. Here is an example.
use a::{ b::{c, d}, e::{f, g} }Breaking apart this single statement into two improves readability.
use a::b::{c, d};
use a::e::{f, g};Grouping is optional if there are fewer than four use lines. If there are four or more use lines, separate groups with a blank line in this order.
- Standard library (
std::) - External crates
- Internal modules (
crate::,taskbroker::) - Super modules (
super::)
If a single external crate needs more than three use lines, put that crate in its own group before other external crates.
The first block below is wrong on purpose (mixed order and no blank lines).
use crate::store::adapters::postgres::{PostgresStore, PostgresStoreConfig};
use crate::store::traits::ActivationStore;
use std::sync::Arc;
use rdkafka::Message;
use rdkafka::admin::{AdminClient, AdminOptions, NewTopic, TopicReplication};
use rdkafka::consumer::{CommitMode, Consumer, StreamConsumer};
use rdkafka::producer::FutureProducer;
use anyhow::{Context, Result};
use std::time::Duration;The second block shows the correct layout.
use std::sync::Arc;
use std::time::Duration;
use rdkafka::Message;
use rdkafka::admin::{AdminClient, AdminOptions, NewTopic, TopicReplication};
use rdkafka::consumer::{CommitMode, Consumer, StreamConsumer};
use rdkafka::producer::FutureProducer;
use anyhow::{Context, Result};
use crate::store::adapters::postgres::{PostgresStore, PostgresStoreConfig};
use crate::store::traits::ActivationStore;