# Path: thingflow/internal/basic.py
# def noop(*args, **kw):
#     """No operation. Returns nothing"""
#     pass


from collections import namedtuple
from thingflow.internal import noop
import threading
import time
import queue
import traceback as tb
import logging
        pass


def _on_next_name(port):
    if port==None or port=='default':
        return 'on_next'
    else:
        return 'on_%s_next' % port

def _on_error_name(port):
    if port==None or port=='default':
        return 'on_error'
    else:
        return 'on_%s_error' % port


def _on_completed_name(port):
    if port==None or port=='default':
        return 'on_completed'
    else:
        return 'on_%s_completed' % port


class CallableAsInputThing:
    """Wrap any callable with the InputThing interface.
    We only pass it the on_next() calls. on_error and on_completed
    can be passed in or default to noops.
    """
    def __init__(self, on_next=None, on_error=None, on_completed=None,
                 port=None):

# Path: thingflow/internal/basic.py
# def noop(*args, **kw):
#     """No operation. Returns nothing"""
#     pass


# Path: thingflow/base.py
from collections import namedtuple
from thingflow.internal import noop
import threading
import time
import queue
import traceback as tb
import logging

        pass


def _on_next_name(port):
    if port==None or port=='default':
        return 'on_next'
    else:
        return 'on_%s_next' % port

def _on_error_name(port):
    if port==None or port=='default':
        return 'on_error'
    else:
        return 'on_%s_error' % port


def _on_completed_name(port):
    if port==None or port=='default':
        return 'on_completed'
    else:
        return 'on_%s_completed' % port


class CallableAsInputThing:
    """Wrap any callable with the InputThing interface.
    We only pass it the on_next() calls. on_error and on_completed
    can be passed in or default to noops.
    """
    def __init__(self, on_next=None, on_error=None, on_completed=None,
                 port=None):

        setattr(self, _on_next_name(port), on_next or noop)