Example #1
0
def CollectAliasesByAddressAsync(elf_path, tool_prefix):
  """Calls CollectAliasesByAddress in a helper process. Returns a Result."""
  def decode(encoded):
    return parallel.DecodeDictOfLists(encoded, key_transform=int)

  return parallel.ForkAndCall(
      _CollectAliasesByAddressAsyncHelper, (elf_path, tool_prefix),
      decode_func=decode)
 def testForkAndCall_normal(self):
     parent_pid = os.getpid()
     result = parallel.ForkAndCall(_ForkTestHelper,
                                   (1, 2, Unpicklable(), self, parent_pid))
     self.assertEqual(3, result.get())
 def testForkAndCall_exception(self):
     parent_pid = os.getpid()
     result = parallel.ForkAndCall(_ForkTestHelper,
                                   (1, 'a', None, self, parent_pid))
     self.assertRaises(TypeError, result.get)