Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added Mailbox::set_receiver to python binding
authorSylvain Lefebvre <slvn-lefebvre@jp.toyota-itc.com>
Thu, 23 Apr 2020 03:16:02 +0000 (12:16 +0900)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 24 Apr 2020 08:27:26 +0000 (10:27 +0200)
src/bindings/python/simgrid_python.cpp

index af3d758..670be45 100644 (file)
@@ -256,7 +256,13 @@ PYBIND11_MODULE(simgrid, m)
             // data.dec_ref(); // FIXME: why does it break python-actor-create?
             return data;
           },
             // data.dec_ref(); // FIXME: why does it break python-actor-create?
             return data;
           },
-          py::call_guard<GilScopedRelease>(), "Blocking data reception");
+          py::call_guard<GilScopedRelease>(), "Blocking data reception")
+      .def("set_receiver",
+        [](Mailbox* self, ActorPtr actor) {
+          self->set_receiver(actor);
+        },
+        py::call_guard<GilScopedRelease>(),
+        "Sets the actor as permanent receiver");
 
   /* Class Comm */
   py::class_<simgrid::s4u::Comm, simgrid::s4u::CommPtr>(m, "Comm", "Communication")
 
   /* Class Comm */
   py::class_<simgrid::s4u::Comm, simgrid::s4u::CommPtr>(m, "Comm", "Communication")