Fixed functions with void return
This commit is contained in:
		@@ -89,8 +89,9 @@ void mrpc::MRPCServer::msg_handler(const std::shared_ptr<restbed::Session> __c,
 | 
			
		||||
            }
 | 
			
		||||
@for (name, ty) in m.args.iter().map(|a| (&a.name, ty_to_str(&a.ty))) {            @ty @name; @name << json_get(__data, "@name");
 | 
			
		||||
            }
 | 
			
		||||
            @if m.ret_stream || m.ret.is_none() {@(s.name)_@(m.name)(@call_args(m));}
 | 
			
		||||
            else {send_msg(__c, @(s.name)_@(m.name)(@call_args(m)));}
 | 
			
		||||
            @if m.ret_stream {@(s.name)_@(m.name)(@call_args(m));}
 | 
			
		||||
            else if m.ret.is_some() {send_msg(__c, @(s.name)_@(m.name)(@call_args(m)));}
 | 
			
		||||
            else {@(s.name)_@(m.name)(@call_args(m)); send_msg(__c, nullptr);}
 | 
			
		||||
        @}}
 | 
			
		||||
        else @{ throw std::exception@{@}; @}
 | 
			
		||||
    @}}
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,10 @@ mrpc::MRPCJWriter& operator>>(const mrpc::@e.name &v, mrpc::MRPCJWriter &w) @{
 | 
			
		||||
    return w;
 | 
			
		||||
@}
 | 
			
		||||
}
 | 
			
		||||
inline mrpc::MRPCJWriter& operator>>(const std::nullptr_t &, mrpc::MRPCJWriter &w) @{
 | 
			
		||||
    w.Null();
 | 
			
		||||
    return w;
 | 
			
		||||
@}
 | 
			
		||||
 | 
			
		||||
template<typename T>
 | 
			
		||||
inline std::vector<T>& operator<<(std::vector<T> &v, const rapidjson::Value &j);
 | 
			
		||||
 
 | 
			
		||||
@@ -36,8 +36,10 @@ export class MRPCConnector @{
 | 
			
		||||
        else if m.ret_stream {fetchEventSource(this.url, @{
 | 
			
		||||
            method: 'POST',
 | 
			
		||||
            body: JSON.stringify(__msg),
 | 
			
		||||
            onmessage: __e => __cbk(JSON.parse(__e.data))
 | 
			
		||||
        @});} else {fetch(this.url, @{method: 'POST', body: JSON.stringify(__msg)@});}
 | 
			
		||||
            onmessage: __e => __cbk(JSON.parse(__e.data)),
 | 
			
		||||
            onerror: __e => @{throw __e;@},
 | 
			
		||||
            onclose: () => __cbk(null)
 | 
			
		||||
        @});} else {return fetch(this.url, @{method: 'POST', body: JSON.stringify(__msg)@}).then(__r => @{@});}
 | 
			
		||||
    @}
 | 
			
		||||
}}
 | 
			
		||||
@}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user