# Path: pq/utils/concurrency.py
# ASYNC_IO = 1        # run in the worker event loop
# THREAD_IO = 3       # run in the event loop executor
# CPUBOUND = 4        # run in a subprocess


import sys
import logging
import inspect
import asyncio
from datetime import datetime, date
from pulsar.utils.slugify import slugify
from pulsar.utils.importer import import_modules
from pulsar.utils.log import lazyproperty
from pulsar.utils.string import to_bytes
from ..utils.concurrency import concurrency_name, ASYNC_IO
    def cfg(self):
        """Configuration  object from :attr:`backend`"""
        return self.backend.cfg

    @property
    def green_pool(self):
        return self.backend.green_pool

    @property
    def wait(self):
        return self.backend.green_pool.wait

    @property
    def http(self):
        """Best possible HTTP session handler
        """
        return self.backend.http_sessions(self.get_concurrency())

    @property
    def _loop(self):
        return self.backend._loop if self.backend else None

    @property
    def type(self):
        '''Type of Job, one of ``regular`` and ``periodic``.'''
        return 'regular'

    def get_concurrency(self):
        '''The concurrency for this job
        '''

# Path: pq/utils/concurrency.py
# ASYNC_IO = 1        # run in the worker event loop
# THREAD_IO = 3       # run in the event loop executor
# CPUBOUND = 4        # run in a subprocess


# Path: pq/tasks/models.py
import sys
import logging
import inspect
import asyncio
from datetime import datetime, date
from pulsar.utils.slugify import slugify
from pulsar.utils.importer import import_modules
from pulsar.utils.log import lazyproperty
from pulsar.utils.string import to_bytes
from ..utils.concurrency import concurrency_name, ASYNC_IO

    def cfg(self):
        """Configuration  object from :attr:`backend`"""
        return self.backend.cfg

    @property
    def green_pool(self):
        return self.backend.green_pool

    @property
    def wait(self):
        return self.backend.green_pool.wait

    @property
    def http(self):
        """Best possible HTTP session handler
        """
        return self.backend.http_sessions(self.get_concurrency())

    @property
    def _loop(self):
        return self.backend._loop if self.backend else None

    @property
    def type(self):
        '''Type of Job, one of ``regular`` and ``periodic``.'''
        return 'regular'

    def get_concurrency(self):
        '''The concurrency for this job
        '''

        return self.concurrency or ASYNC_IO