Skip to content

Conversation

muhamadazmy
Copy link
Contributor

@muhamadazmy muhamadazmy commented Apr 17, 2025

#[prost(target = "crate::protobuf::cluster::RunMode")]
#[strum(serialize_all = "snake_case")]
pub enum RunMode {
Leader,
Follower,
Follower = 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bilrost requires numeric enums to have an "EmptyState" which is always the variant with zero value. It's up to us to introduce Unknown variant (like what we do with protobuf) or assign the 0 value to one of the existing variants.

@muhamadazmy muhamadazmy force-pushed the pr3172 branch 4 times, most recently from 5172955 to 2fa50cc Compare April 23, 2025 11:14
@muhamadazmy muhamadazmy force-pushed the pr3172 branch 4 times, most recently from 1c9a326 to 08b4d59 Compare April 25, 2025 10:38
@muhamadazmy muhamadazmy changed the title WIP: Using Bilrost for GetNodeStatus messages Using Bilrost for GetNodeStatus messages Apr 25, 2025
@muhamadazmy muhamadazmy marked this pull request as ready for review April 25, 2025 10:38
@muhamadazmy muhamadazmy force-pushed the pr3172 branch 11 times, most recently from 0f73075 to b1cbba0 Compare April 28, 2025 09:47
@muhamadazmy muhamadazmy force-pushed the pr3172 branch 8 times, most recently from 5ed1d99 to d132aae Compare April 29, 2025 07:10
@@ -12,6 +12,7 @@ use std::collections::BTreeMap;
use std::time::{Duration, Instant};

use prost_dto::IntoProst;
use restate_encoding::NetSerde;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be ever-so-slightly nicer if this follows our import ordering convention.

Also introduce two new derive macros:
- `BilrostNewType` to use with all ID types or any tuple with a single item. This will
effectively flatten this tuple to its inner type. Given that the inner field is bilrost serializable
- `NetworkMessage` which must be derived for each message that is going to be send over the network
@muhamadazmy muhamadazmy merged commit d71414d into restatedev:main Apr 29, 2025
54 checks passed
@muhamadazmy muhamadazmy deleted the pr3172 branch April 29, 2025 11:43
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants