From a895f9a26f25c68fdea2317c727effa8636e89d0 Mon Sep 17 00:00:00 2001 From: Cedric RICARD Date: Sat, 3 Jan 2009 00:05:26 +0000 Subject: [PATCH] New version of send_result() function, using Result() instead of Maybe() --- calexium_lib/net_services/CXM_generic_protocol.anubis | 15 +++++++++++++++ 1 file changed, 15 insertions(+), 0 deletions(-) diff --git a/calexium_lib/net_services/CXM_generic_protocol.anubis b/calexium_lib/net_services/CXM_generic_protocol.anubis index e331a3c..426d071 100644 --- a/calexium_lib/net_services/CXM_generic_protocol.anubis +++ b/calexium_lib/net_services/CXM_generic_protocol.anubis @@ -90,6 +90,21 @@ public define One failure then send_ACK_error(queue, cmd_id), success(msg) then send_ACK_ok(queue, cmd_id, msg) }. + +public define One + send_result + ( + MessageQueue queue, + Word32 cmd_id, + Result((Word32, String), Message) mb_msg + )= + if mb_msg is + { + error(err) then + if err is (err_code, err_string) then + send_ACK_error(queue, cmd_id, err_code, err_string), + ok(msg) then send_ACK_ok(queue, cmd_id, msg) + }. public define One send_result -- libgit2 0.21.4