Skip to content

lazy_parallellize having trouble with function context? #164

Description

@larroy

I'm using a function defined in the current file in pseq, and seems it errors out not being able to find other referenced functions or even simple types like Dict. This works fine when using seq.

I think the problem is with pickling the target function in lazy_parallelize:

    partitions = split_every(partition_size, iter(result))
    packed_partitions = (pack(func, (partition,)) for partition in partitions)
    for pool_result in pool.imap(unpack, packed_partitions):
        yield pool_result
    pool.terminate()

I executed on my own the function with pool.imap and works fine.

Wouldn't it be better not to use pickling to avoid these kind of problems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions