Skip to content
Snippets Groups Projects
Verified Commit b9e278c6 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

Bump tarantool-module

Also, use brand new `tarantool::proc` macro for stored procedres.
parent add40776
No related branches found
No related tags found
1 merge request!68Bump tarantool-module
Pipeline #3700 passed
use error::CoercionError;
use nix::sys::signal::{self, Signal};
use nix::unistd::Pid;
use std::os::raw::{c_char, c_int, c_void};
......@@ -5,10 +6,8 @@ use std::process::Stdio;
use structopt::StructOpt;
use ::raft::prelude as raft;
use ::tarantool::error::TarantoolErrorCode::ProcC as ProcCError;
use ::tarantool::set_error;
use ::tarantool::proc;
use ::tarantool::tlua;
use ::tarantool::tuple::{FunctionArgs, FunctionCtx, Tuple};
use indoc::indoc;
use message::Message;
use std::convert::TryFrom;
......@@ -207,25 +206,10 @@ fn init_handlers() {
);
}
#[no_mangle]
pub extern "C" fn raft_interact(_: FunctionCtx, args: FunctionArgs) -> c_int {
let raft_node = node();
// Conversion pipeline:
// FunctionArgs -> Tuple -?-> traft::row::Message -?-> raft::Message;
let m: traft::row::Message = match Tuple::from(args).into_struct() {
Ok(v) => v,
Err(e) => return set_error!(ProcCError, "{e}"),
};
let m = match raft::Message::try_from(m) {
Ok(v) => v,
Err(e) => return set_error!(ProcCError, "{e}"),
};
raft_node.step(m);
0
#[proc(packed_args)]
fn raft_interact(msg: traft::row::Message) -> Result<(), CoercionError> {
node().step(raft::Message::try_from(msg)?);
Ok(())
}
fn rm_tarantool_files(data_dir: &str) {
......
Subproject commit 4f149532575f305f32dc557b7684b3cf561b3093
Subproject commit 58db7dff2b0a76eee0d693c2f83f9215f46c824e
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment