mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-22 20:50:04 +01:00
make the aggregate method send
This commit is contained in:
parent
6728cfbfac
commit
aa7a34ffe8
@ -110,7 +110,7 @@ mopafy!(Aggregate);
|
||||
|
||||
/// Helper trait to define multiple aggregate with the same content but a different name.
|
||||
/// Commonly used when you must aggregate a search with POST or with GET for example.
|
||||
pub trait AggregateMethod: 'static + Default {
|
||||
pub trait AggregateMethod: 'static + Default + Send {
|
||||
fn event_name() -> &'static str;
|
||||
}
|
||||
|
||||
|
@ -72,9 +72,12 @@ pub fn extract_user_agents(request: &HttpRequest) -> Vec<String> {
|
||||
}
|
||||
|
||||
pub struct Message {
|
||||
// Since the type_id is solved statically we cannot retrieve it from the Box.
|
||||
// Thus we have to send it in the message directly.
|
||||
type_id: TypeId,
|
||||
event: Box<dyn Aggregate>,
|
||||
// Same for the aggregate function.
|
||||
aggregator_function: fn(Box<dyn Aggregate>, Box<dyn Aggregate>) -> Option<Box<dyn Aggregate>>,
|
||||
event: Box<dyn Aggregate>,
|
||||
}
|
||||
|
||||
impl Message {
|
||||
|
Loading…
x
Reference in New Issue
Block a user