Author zmedico
Recipients Adam.Bishop, Christian H, christian.heimes, martius, neologix, pitrou, vstinner, yselivanov, zmedico
Date 2018-03-04.00:16:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm not sure about possible use cases that might conflict with this approach, but using a separate event loop for each pid seems very reasonable to me, as follows:

_default_policy = asyncio.get_event_loop_policy()
_pid_loop = {}

class MultiprocessingPolicy(asyncio.AbstractEventLoopPolicy):
	def get_event_loop(self):
		pid = os.getpid()
		loop = _pid_loop.get(pid)
		if loop is None:
			loop = self.new_event_loop()
			_pid_loop[pid] = loop
		return loop

	def new_event_loop(self):
		return _default_policy.new_event_loop()

Date User Action Args
2018-03-04 00:16:44zmedicosetrecipients: + zmedico, pitrou, vstinner, christian.heimes, neologix, yselivanov, Adam.Bishop, martius, Christian H
2018-03-04 00:16:44zmedicosetmessageid: <>
2018-03-04 00:16:44zmedicolinkissue21998 messages
2018-03-04 00:16:44zmedicocreate