# Path: forsun/action/action.py
# class Action(object):
#     def __init__(self, ts, plan, action, params):
#         self.ts = ts
#         self.plan = plan
#         self.action = action
#         self.params = params
# 
#     @gen.coroutine
#     def execute(self, *args, **kwargs):
#         raise NotImplementedError()
# 
# Path: forsun/utils.py
#     def ensure_bytes(s):
#     def ensure_unicode(s):
#     def ensure_bytes(s):
#     def ensure_unicode(s):
# def load_extensions(name):
# def parse_cmd(command, parse_kwargs = True, split_cmd = True):
# class ExtensionsNotFound(Exception): pass
# 
# Path: forsun/error.py
# class ActionExecuteRetry(Exception):
#     def __init__(self):
#         pass


import time
import logging
import socket
import beanstalkt
from tornado import gen
from tornado.iostream import IOStream
from ..action import Action
from ...utils import unicode_type
from ...error import ActionExecuteRetry
# -*- coding: utf-8 -*-
# 15/7/3
# create by: snower


class BeanstalktClient(beanstalkt.Client):
    def _reconnect(self):
        pass

    @gen.coroutine

# Path: forsun/action/action.py
# class Action(object):
#     def __init__(self, ts, plan, action, params):
#         self.ts = ts
#         self.plan = plan
#         self.action = action
#         self.params = params
# 
#     @gen.coroutine
#     def execute(self, *args, **kwargs):
#         raise NotImplementedError()
# 
# Path: forsun/utils.py
#     def ensure_bytes(s):
#     def ensure_unicode(s):
#     def ensure_bytes(s):
#     def ensure_unicode(s):
# def load_extensions(name):
# def parse_cmd(command, parse_kwargs = True, split_cmd = True):
# class ExtensionsNotFound(Exception): pass
# 
# Path: forsun/error.py
# class ActionExecuteRetry(Exception):
#     def __init__(self):
#         pass


# Path: forsun/action/drivers/beanstalkaction.py
import time
import logging
import socket
import beanstalkt
from tornado import gen
from tornado.iostream import IOStream
from ..action import Action
from ...utils import unicode_type
from ...error import ActionExecuteRetry

# -*- coding: utf-8 -*-
# 15/7/3
# create by: snower


class BeanstalktClient(beanstalkt.Client):
    def _reconnect(self):
        pass

    @gen.coroutine

    def connect(self):