This question might be unclear - if so, that probably because I'm not entirely shure how to ask the question - but here goes:
I have a Python class from which I would like to call a function.
The class does not have access to the data that the function should operate on - basically, I would like the class to send a message to another process, that calls the function. Something like:
from multiprocessing import Process
class Foo():
def bar(phonenumber):
do_something()
send_message(phonenumber)
def daemon(data, phonenumber):
while nothing_receivied(phonenumber):
do_nothin()
also_do_not_consume_too_much_CPU()
if message_received(phonenumber):
function(data)
p = Process(target=daemon, args=(data, phonenumber))
p.start()
p.join()
calling Foo.bar(phonenumber) should then have the extra effect that function is performed on data - how is this achievable?
Cheers!