hyperactor_mesh/
test_utils.rs

1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9use async_trait::async_trait;
10use hyperactor::Actor;
11use hyperactor::Bind;
12use hyperactor::Context;
13use hyperactor::Handler;
14use hyperactor::Named;
15use hyperactor::Unbind;
16use serde::Deserialize;
17use serde::Serialize;
18
19/// Message that can be sent to an EmptyActor.
20#[derive(Serialize, Deserialize, Debug, Named, Clone, Bind, Unbind)]
21pub struct EmptyMessage();
22
23#[derive(Debug, PartialEq, Default, Actor)]
24#[hyperactor::export(
25    handlers = [
26        EmptyMessage { cast = true },
27    ],
28)]
29pub struct EmptyActor();
30
31#[async_trait]
32impl Handler<EmptyMessage> for EmptyActor {
33    async fn handle(&mut self, _: &Context<Self>, _: EmptyMessage) -> Result<(), anyhow::Error> {
34        Ok(())
35    }
36}
37hyperactor::remote!(EmptyActor);