Skip to content

Instantly share code, notes, and snippets.

View ldjebran's full-sized avatar

Djebran Lezzoum ldjebran

View GitHub Profile
@ldjebran
ldjebran / pyenv.sh
Last active October 11, 2016 14:23
#!/usr/bin/env bash
# Copyright 2016 Djebran Lezzoum All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#!/usr/bin/env bash
# Copyright 2016 Djebran Lezzoum All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
"""
twisted async/await with asyncio reactor and uvloop
"""
import asyncio
import uvloop
from asyncio.tasks import ensure_future
try:
# as per github source the asyncio reactor is intended to be released in future version
"""
twisted async/await with asyncio reactor
"""
import asyncio
from asyncio.tasks import ensure_future
try:
# as per github source the asyncio reactor is intended to be released in future version
# https://github.com/twisted/twisted/blob/trunk/src/twisted/internet/asyncioreactor.py
@ldjebran
ldjebran / txt.py
Last active September 23, 2016 08:25
"""
twisted async/await
"""
from twisted.web import server
from twisted.web.resource import Resource
from twisted.internet import reactor, endpoints, defer
@defer.inlineCallbacks