_register_builtin_connections: io_type="terminal", variant="threaded" as moler.io.raw.terminal.Terminal
@@ -387,6 +387,7 @@ def get_connection(name=None, io_type=None, variant=None, **constructor_kwargs):
def _register_builtin_connections():
from moler.io.raw.memory import ThreadedFifoBuffer
from moler.io.raw.tcp import ThreadedTcp
+ from moler.io.raw.terminal import Terminal
def mlr_conn_utf8(name):
return ObservableConnection(encoder=lambda data: data.encode("utf-8"),
@@ -405,13 +406,22 @@ def _register_builtin_connections():
port=port, host=host) # TODO: add name
return io_conn
+ def terminal_thd_conn(port, name=None):
+ mlr_conn = mlr_conn_utf8(name=name)
+ # TODO: rename into ThreadedTerminal
+ io_conn = Terminal(moler_connection=mlr_conn) # TODO: add name, logger
+ return io_conn
+
+ # TODO: unify passing logger to io_conn (logger/logger_name)
ConnectionFactory.register_construction(io_type="memory",
variant="threaded",
constructor=mem_thd_conn)
ConnectionFactory.register_construction(io_type="tcp",
variant="threaded",
constructor=tcp_thd_conn)
-
+ ConnectionFactory.register_construction(io_type="terminal",
+ variant="threaded",
+ constructor=terminal_thd_conn)
# actions during import
_register_builtin_connections()
