MCPcopy Create free account
hub / github.com/BabitMF/bmf / set_callback

Method set_callback

bmf/engine/c_engine/src/loader/py_module_loader.cpp:153–161  ·  view source on GitHub ↗

set_callback(...)

Source from the content-addressed store, hash-verified

151
152 // set_callback(...)
153 void set_callback(
154 std::function<CBytes(int64_t, CBytes)> callback_endpoint) override {
155 py::gil_scoped_acquire gil;
156 auto py_func = py::cpp_function([=](int64_t key, py::bytes &value) {
157 auto ret = callback_endpoint(key, py::cast<CBytes>(value));
158 return py::cast(ret); // cbytes
159 });
160 call_func("set_callback", py_func);
161 }
162
163 bool is_subgraph() override {
164 py::gil_scoped_acquire gil;

Callers 2

BMFModuleMethod · 0.45
node.cppFile · 0.45

Calls 1

castFunction · 0.85

Tested by

no test coverage detected