justheuristic / prefetch_generator

Simple package that makes your generator work in background thread
The Unlicense
272 stars 22 forks source link

Decorator bug #3

Closed mahnerak closed 5 years ago

mahnerak commented 6 years ago
#decorator
class background:
    def __init__(self,max_prefetch=1):
        self.max_prefetch = max_prefetch
    def __call__(self,gen):
        def bg_generator(*args,**kwargs):
            return BackgroundGenerator(gen(*args,**kwargs))
        return bg_generator

Decorator never works! max_prefetch is never passed to BackgroundGenerator

justheuristic commented 5 years ago

Thank you! i am sorry it took me so long to notice your issue :( Will fix right away