polyswarmclient.producer.jobprocessor
¶
Module Contents¶
-
class
polyswarmclient.producer.jobprocessor.
PendingJob
(key: str, jobs: List[JobRequest], future: Future)[source]¶ A wrapper around a list of Jobs that are processing in the backend
-
__store_job_response
(self, response: JobResponse, confidence_modifier: Optional[ConfidenceModifier])[source]¶ Converts a JobResponse to ScanResult with modified confidence. Stores at the correct index in internal results
- Parameters
response – JobResponse to conver
confidence_modifier – an optional ConfidenceModifier to potentially change the confidence
- Returns
-
-
class
polyswarmclient.producer.jobprocessor.
JobProcessor
(redis: Redis, queue: str, confidence_modifier: Optional[ConfidenceModifier], period: float = 0.25, redis_error_callback: Optional[Callable[[], Coroutine]] = None)[source]¶ Keeps track pending jobs, and polls the PendingJob results every period of time (.5 seconds)