concrete.util.service_wrapper module

class concrete.util.service_wrapper.ConcreteServiceClientWrapper(host, port)

Bases: object

Base class for a wrapper around a Concrete service client. Implements the context manager interface so client can be controlled using the with: statement (client connection is closed when the with: scope is exited).

Parameters:
  • host (str) – hostname to connect to
  • port (int) – port number to connect to
class concrete.util.service_wrapper.ConcreteServiceWrapper(implementation)

Bases: object

Base class for a wrapper around a Concrete service that runs in (blocks) the current process.

Parameters:implementation (object) – handler of specified concrete service
serve(host, port)

Serve on specified host and port in current process, blocking until server is killed. (If server is not killed by signal or otherwise it will block forever.)

Parameters:
  • host (str) – hostname to serve on
  • port (int) – port number to serve on
class concrete.util.service_wrapper.HTTPConcreteServiceClientWrapper(uri)

Bases: object

Base class for a wrapper around an HTTP Concrete service client. Implements the context manager interface so client can be controlled using the with: statement (client connection is closed when the with: scope is exited).

Parameters:uri (str) –
class concrete.util.service_wrapper.SubprocessConcreteServiceWrapper(implementation, host, port, timeout=None)

Bases: object

Base class for a wrapper around a Concrete service that runs in a subprocess; implements the context manager interface so subprocess can be controlled using the with: statement (subprocess is stopped and joined when the with: scope is exited).

Parameters:
  • implementation (object) – handler of specified concrete service
  • host (str) – hostname that will be served on when context is entered
  • port (int) – port number that will be served on when context is entered
  • timeout (int) – number of seconds to wait for server to start in subprocess, when context is entered (if None, wait forever)
SLEEP_INTERVAL = 0.1