from typing import Callable
import asyncio


def add_async_job(target: Callable, *args):
    """Add a callable to the event loop."""
    loop = asyncio.get_event_loop()

    if asyncio.iscoroutine(target):
        task = loop.create_task(target)
    elif asyncio.iscoroutinefunction(target):
        task = loop.create_task(target(*args))
    else:
        task = loop.run_in_executor(None, target, *args)

    return task