Open sleipnir opened 1 year ago
For now I created a workaround making the user enter the name of the fully qualified protobuf type:
pub fn set_language(msg: Message, ctx: Context) -> Value {
info!("Actor msg: {:?}", msg);
return match msg.body::<Request>() {
Ok(request) => {
let lang = request.language;
info!("Setlanguage To: {:?}", lang);
let mut reply = Reply::default();
reply.response = lang;
match &ctx.state::<State>() {
Some(state) => Value::new()
.state::<State>(&state.as_ref().unwrap(), "domain.State".to_string()) // workaround here
.response(&reply, "domain.Reply".to_string())
.to_owned(),
_ => Value::new()
.state::<State>(&State::default(), "domain.State".to_string()) // workaround here
.response(&reply, "domain.Reply".to_string())
.to_owned(),
}
}
Err(_e) => Value::new()
.state::<State>(&State::default(), "domain.State".to_string()) // workaround here
.to_owned(),
};
}
Blocked by issues in the prost library regarding the Any message parser:
Related to https://github.com/tokio-rs/prost/issues/921 and https://github.com/tokio-rs/prost/pull/923