# Path: pq/api.py



import time
import asyncio
import threading
import greenlet
from pq import api
    def __call__(self, asyncio=False):
        if asyncio:
            return self.asyncio()
        else:
            return self.greenlet_info()

    def greenlet_info(self):
        return greenlet.getcurrent().parent is not None

    async def asyncio(self):
        await asyncio.sleep(1)
        return self.greenlet_info()


class CpuBoundBigLog(api.Job):
    concurrency = api.CPUBOUND

    def __call__(self):
        # Log more date then the pipe buffer, as logs are send through the pipe
        for i in range(1024):
            self.backend.logger.debug('*'*1024)


@api.job()
async def scrape(self, url=None):
    assert url, "url is required"
    request = await self.http.get(url)
    return request.text



# Path: pq/api.py



# Path: tests/example/jobs/standard.py
import time
import asyncio
import threading
import greenlet
from pq import api

    def __call__(self, asyncio=False):
        if asyncio:
            return self.asyncio()
        else:
            return self.greenlet_info()

    def greenlet_info(self):
        return greenlet.getcurrent().parent is not None

    async def asyncio(self):
        await asyncio.sleep(1)
        return self.greenlet_info()


class CpuBoundBigLog(api.Job):
    concurrency = api.CPUBOUND

    def __call__(self):
        # Log more date then the pipe buffer, as logs are send through the pipe
        for i in range(1024):
            self.backend.logger.debug('*'*1024)


@api.job()
async def scrape(self, url=None):
    assert url, "url is required"
    request = await self.http.get(url)
    return request.text



@api.job(concurrency=api.THREAD_IO)