diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-07-06 22:55:08 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-07-06 22:55:08 +0200 |
commit | 083849161f075878e4175cd03cb7afa83d64e7f5 (patch) | |
tree | 101feb02f6306f8f8b335faa39d74f1eaafc8d54 /raphodo/thumbloadbalancer.py | |
parent | b5287ed17bda10877d84ba86fcf148ee74b93b9b (diff) |
New upstream version 0.9.0upstream/0.9.0
Diffstat (limited to 'raphodo/thumbloadbalancer.py')
-rwxr-xr-x | raphodo/thumbloadbalancer.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/raphodo/thumbloadbalancer.py b/raphodo/thumbloadbalancer.py new file mode 100755 index 0000000..9576ab7 --- /dev/null +++ b/raphodo/thumbloadbalancer.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 + +# Copyright (C) 2015-2016 Damon Lynch <damonlynch@gmail.com> + +# This file is part of Rapid Photo Downloader. +# +# Rapid Photo Downloader is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Rapid Photo Downloader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Rapid Photo Downloader. If not, +# see <http://www.gnu.org/licenses/>. + +"""Starts load balancer used for thumbnail extraction and caching""" + +__author__ = 'Damon Lynch' +__copyright__ = "Copyright 2015-2016, Damon Lynch" + +from raphodo.interprocess import LoadBalancerWorkerManager, LoadBalancer + + +class ThumbnailLoadBalancerWorkerManager(LoadBalancerWorkerManager): + """ + Manages thumbnail extractors + """ + def __init__(self, no_workers: int, + backend_port: int, + sink_port: int, + logging_port: int) -> None: + super().__init__(no_workers, backend_port, sink_port, logging_port) + self._process_name = 'Thumbnail Load Balancer Manager' + self._process_to_run = 'thumbnailextractor.py' + + +class ThumbnailLoadBalancer(LoadBalancer): + """ + Managers the thumbnail load balancer + """ + def __init__(self) -> None: + super().__init__('Thumbnail', ThumbnailLoadBalancerWorkerManager) + +if __name__ == "__main__": + loadbalancer = ThumbnailLoadBalancer() |