MCPcopy Create free account
hub / github.com/breach/thrust / SendInvoke

Method SendInvoke

src/api/api_server.cc:282–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void
283APIServer::Client::SendInvoke(
284 const API::MethodCallback& callback,
285 unsigned int target,
286 const std::string method,
287 scoped_ptr<base::DictionaryValue> args)
288{
289 /* Runs on IO Thread. */
290 unsigned int action_id = ++action_id_;
291
292 invokes_[action_id] = callback;
293
294 base::DictionaryValue action;
295 action.SetString("_action", "invoke");
296 action.SetInteger("_id", action_id);
297 action.SetInteger("_target", target);
298 action.SetString("_method", method);
299 action.Set("_args", args->DeepCopy());
300
301 std::string payload;
302 base::JSONWriter::Write(&action, &payload);
303 payload += "\n" + std::string(kSocketBoundary) + "\n";
304
305 std::cout << payload;
306 std::cout.flush();
307}
308
309
310/******************************************************************************/

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected