Skip to content

Commit

Permalink
Merge pull request #12 from jeronimoalbi/develop
Browse files Browse the repository at this point in the history
Update to 1.0.0-alpha.10
  • Loading branch information
nullproxy authored Sep 9, 2016
2 parents e54c0d7 + a7b430e commit 4df55a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion katana/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.0-alpha.9'
__version__ = '1.0.0-alpha.10'
9 changes: 1 addition & 8 deletions katana/service/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@
from ..payload import Payload
from ..payload import TransportPayload
from ..worker import ComponentWorker
from ..worker import SERVICE_CALL

LOG = logging.getLogger(__name__)

# Constants for response meta frame
SE = SERVICE_CALL = b'\x01'
FI = FILES = b'\x02'
TR = TRANSACTIONS = b'\x03'

# Allowed response meta values
META_VALUES = (SE, FI, TR)


class ServiceWorker(ComponentWorker):
"""Service worker task class."""
Expand Down
14 changes: 13 additions & 1 deletion katana/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@

LOG = logging.getLogger(__name__)

# Constants for response meta frame
EMPTY_META = b'\x00'
SE = SERVICE_CALL = b'\x01'
FI = FILES = b'\x02'
TR = TRANSACTIONS = b'\x03'

# Allowed response meta values
META_VALUES = (EMPTY_META, SE, FI, TR)


class ComponentWorker(object):
"""Component worker task class.
Expand Down Expand Up @@ -201,7 +210,10 @@ def process_stream(self, stream):
LOG.exception('Component failed')
payload = ErrorPayload.new().entity()

return [self.get_response_meta(payload), serialization.pack(payload)]
return [
self.get_response_meta(payload) or EMPTY_META,
serialization.pack(payload),
]

@asyncio.coroutine
def _start_handling_requests(self):
Expand Down

0 comments on commit 4df55a5

Please sign in to comment.