Search code examples
memgraphdb

Can I pass around mgp.ProcCtx and implement parallel graph algorithms in Python that use the actual graph?


I am using Memgraph Platform 2.6.4 which includes MAGE 1.5.1. I noticed that MAGE has an interesting part of the code that tells me that you can use multiprocessing on the server. But, can I pass around mgp.ProcCtx and implement parallel graph algorithms in Python which use the actual graph, or do I need to work on graph representations like in this example?


Solution

  • You can pass around mgp.ProcCtx object to functions and work on them in multiprocessing way. But what you can't do is write to Memgraph changes on that processing graph in multiprocessing way.