You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wubloader/common/common
Mike Lang 44d0c0269a cache results of common.segments.best_segments_by_start
The restreamer spends most of its time iterating through segments (parsing them, determining the best one for each start time)
to serve large time ranges. Since this only depends on the list of filenames read from disk,
we can cache it for a given hour as long as that list is identical.

This is a little trickier than it sounds because best_segments_by_start is an iterator
and in most cases it won't be fully consumed. So we introduce a `CachedIterator` abstraction
that will both remember the previously yielded values, and keep track of the live iterator
so it can be resumed again if a previous invocation only partially consumed it.

This also has the nice side effect of merging simultaneous operations - if two requests come in
for the same hour at the same time, they'll share one iterator and both consume the results
as they come in.
3 years ago
..
__init__.py Improve WSGIServer graceful shutdown handling 3 years ago
cached_iterator.py cache results of common.segments.best_segments_by_start 3 years ago
database.py Set up plumbing for multi-range videos and implement no-transition fast cut videos only 3 years ago
dateutil.py Audit and fix all usage of dateutil 6 years ago
flask_stats.py Remove flask response size tracking 5 years ago
googleapis.py common.googleapis: Fix a bug in retrying failed access token get 5 years ago
requests.py more py3 fixes 3 years ago
segments.py cache results of common.segments.best_segments_by_start 3 years ago
stats.py py3 fixes for common 3 years ago