def with_uvloop_if_possible(f, *args, **kwargs):
    """ Simple decorator to provide optional uvloop usage"""
    try:
        import uvloop
        import asyncio
        asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
        print('uvloop will be used')
    except ImportError:
        print('uvloop unavailable')
    return f(*args, **kwargs)
Simple decorator to provide optional uvloop usage