How to use the aiomultiprocess.Process function in aiomultiprocess

To help you get started, we’ve selected a few aiomultiprocess examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jreese / aiomultiprocess / tests / core.py View on Github external
async def test_process(self):
        p = amp.Process(target=sleepypid, name="test_process")
        p.start()

        self.assertEqual(p.name, "test_process")
        self.assertTrue(p.pid)
        self.assertTrue(p.is_alive())

        await p.join()
        self.assertFalse(p.is_alive())
github jreese / aiomultiprocess / tests / core.py View on Github external
async def test_process_timeout(self):
        p = amp.Process(target=sleepypid, args=(1,))
        p.start()

        with self.assertRaises(asyncio.TimeoutError):
            await p.join(timeout=0.01)