Skip to content

Commit

Permalink
Merge pull request #63 from sloria/overrideable-request-handler
Browse files Browse the repository at this point in the history
Make request handler class overrideable and unprivatize MLLPRequestHandler
  • Loading branch information
svituz authored Jan 24, 2020
2 parents 53da4f9 + fbc0ee1 commit d36236b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hl7apy/mllp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __str__(self):
return 'The string received is not a valid HL7 message'


class _MLLPRequestHandler(StreamRequestHandler):
class MLLPRequestHandler(StreamRequestHandler):
encoding = 'utf-8'

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -164,12 +164,12 @@ class MLLPServer(ThreadingMixIn, TCPServer):
"""
allow_reuse_address = True

def __init__(self, host, port, handlers, timeout=10):
def __init__(self, host, port, handlers, timeout=10, request_handler_class=MLLPRequestHandler):
self.host = host
self.port = port
self.handlers = handlers
self.timeout = timeout
TCPServer.__init__(self, (host, port), _MLLPRequestHandler)
TCPServer.__init__(self, (host, port), request_handler_class)


class AbstractHandler(object):
Expand Down

0 comments on commit d36236b

Please sign in to comment.