Skip to content

Conversation

@dankondr
Copy link

At the moment FeedEndpoint processes each feed item sequentially. I need to be able to customise how it runs tasks to parallel execution, thats why I moved items processing in dedicated method.

@dankondr
Copy link
Author

dankondr commented Jul 26, 2021

Example of the new usage:

async def _process_items(...):
    if isinstance(items, AsyncIterable):
        await asyncio.gather(
            *(
                self._populate_feed(feed, item, request_is_secure)
                async for item in items
            )
        )
    else:
        await asyncio.gather(
            *(self._populate_feed(feed, item, request_is_secure) for item in items)
        )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant