# Path: pipelinehost.py
# class PipelineClient(object):
#     """Provides a client to the PipelineHost."""
# 
#     def __init__(self, port=DEFAULT_PORT, hostname='localhost', verbose=False):
#         self.verbose = verbose
#         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#         try:
#             self.sock.connect((hostname, port))
#         except socket.error:
#             raise IOError("Could not connect to pipelinehost on %s:%d. "
#                           "Make sure that pipelinehost is running." %
#                           (hostname, port))
# 
#     def parse(self, text, force_nouns=None, force_verbs=None):
#         """Parse text using a remote pipeline."""
#         # Strip any trailing punctuation.
#         text = text.strip()
#         # Wrap in kwargs
#         return _socket_parse(asocket=self.sock, text=text, force_nouns=force_nouns,
#                              force_verbs=force_verbs, verbose=self.verbose)
# 
#     def close(self):
#         """Close the connection to the pipeline host.
# 
#         If you need the connection closed promptly, it's wise to call
#         this, but garbage collection will accomplish the same purpose.
#         """
#         try:
#             self.sock.shutdown(socket.SHUT_RDWR)
#         except socket.error:
#             pass
#         self.sock.close()


import random
import string
from multiprocessing import Process
from pipelinehost import PipelineClient
#!/usr/bin/env python
"""Stress test for the pipelinehost."""

# Copyright (C) 2013 Constantine Lignos
#
# SLURP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SLURP is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SLURP.  If not, see <http://www.gnu.org/licenses/>.




def stress():
    """Stress the pipeline."""
    try:
        while True:

# Path: pipelinehost.py
# class PipelineClient(object):
#     """Provides a client to the PipelineHost."""
# 
#     def __init__(self, port=DEFAULT_PORT, hostname='localhost', verbose=False):
#         self.verbose = verbose
#         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#         try:
#             self.sock.connect((hostname, port))
#         except socket.error:
#             raise IOError("Could not connect to pipelinehost on %s:%d. "
#                           "Make sure that pipelinehost is running." %
#                           (hostname, port))
# 
#     def parse(self, text, force_nouns=None, force_verbs=None):
#         """Parse text using a remote pipeline."""
#         # Strip any trailing punctuation.
#         text = text.strip()
#         # Wrap in kwargs
#         return _socket_parse(asocket=self.sock, text=text, force_nouns=force_nouns,
#                              force_verbs=force_verbs, verbose=self.verbose)
# 
#     def close(self):
#         """Close the connection to the pipeline host.
# 
#         If you need the connection closed promptly, it's wise to call
#         this, but garbage collection will accomplish the same purpose.
#         """
#         try:
#             self.sock.shutdown(socket.SHUT_RDWR)
#         except socket.error:
#             pass
#         self.sock.close()


# Path: stress_pipelinehost.py
import random
import string
from multiprocessing import Process
from pipelinehost import PipelineClient

#!/usr/bin/env python
"""Stress test for the pipelinehost."""

# Copyright (C) 2013 Constantine Lignos
#
# SLURP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SLURP is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SLURP.  If not, see <http://www.gnu.org/licenses/>.




def stress():
    """Stress the pipeline."""
    try:
        while True:

            parser = PipelineClient()