"interactive" terminal-based component?

#1

Hi,

Is it possible to create a single Autobahn(Python) component that allows terminal I/O on the frontend and interacts with a router and other WAMP components on the backend?

I’d like to start the component from the terminal command line, create the WAMP session, invoke an editor (ex. vim) in the component’s onJoin() method, then send notifications to other components upon exiting the editor (according to any changes made).

I’m using Twisted and since it appears to take over sys.stdout I’m not sure this is possible?

Thanks for any answers/tips!

Dave

0 Likes

#2

Yes, it appears to be possible. I had a bug in my code and now I’m able to invoke the editor. Sorry for the distraction.

···

On Wednesday, May 25, 2016 at 11:42:06 AM UTC-4, Dave Barndt wrote:

Hi,

Is it possible to create a single Autobahn(Python) component that allows terminal I/O on the frontend and interacts with a router and other WAMP components on the backend?

I’d like to start the component from the terminal command line, create the WAMP session, invoke an editor (ex. vim) in the component’s onJoin() method, then send notifications to other components upon exiting the editor (according to any changes made).

I’m using Twisted and since it appears to take over sys.stdout I’m not sure this is possible?

Thanks for any answers/tips!

Dave

0 Likes

#3

Hi Dave,

FWIW, Twisted has something called "Conch": http://twistedmatrix.com/trac/wiki/TwistedConch

And as an extension, Crossbar.io has a development features based on Manhole that lets you log into a live running Crossbar.io node in a SSH terminal session! Which is kinda neat;) Because you can then peek and poke around while the node is running. So yeah, there you also have an interactive user session and a background WAMP session running in the same program.

I'm not sure .. is that similar to what you have now solved for your situation?

Cheers,
/Tobias

···

Am 25.05.2016 um 17:56 schrieb Dave Barndt:

Yes, it appears to be possible. I had a bug in my code and now I'm able to
invoke the editor. Sorry for the distraction.

On Wednesday, May 25, 2016 at 11:42:06 AM UTC-4, Dave Barndt wrote:

Hi,

Is it possible to create a single Autobahn(Python) component that allows
terminal I/O on the frontend and interacts with a router and other WAMP
components on the backend?

I'd like to start the component from the terminal command line, create the
WAMP session, invoke an editor (ex. vim) in the component's onJoin()
method, then send notifications to other components upon exiting the editor
(according to any changes made).

I'm using Twisted and since it appears to take over sys.stdout I'm not
sure this is possible?

Thanks for any answers/tips!

Dave

0 Likes

#4

Hi Tobias!

Thanks for the pointers and info. My use case isn’t exactly the same as what you describe - basically I start with a terminal session, then I want to start an editor, make some changes to a configuration file, and notify various running WAMP components if their configuration changed. I could have each component monitoring the configuration file for changes, but it seemed simpler/cleaner to actually create a simple WAMP component “wrapper” around the editing session in the terminal, which exists only as long as the editing session command is running. It knows the exact changes made to the configuration file, and simply publishes the appropriate events to the affected WAMP components.

But - I’m filing away your information for some as-yet-unknown application - great/helpful information as always!

Thanks,

Dave

···

On Wednesday, May 25, 2016 at 4:14:46 PM UTC-4, Tobias Oberstein wrote:

Hi Dave,

FWIW, Twisted has something called “Conch”:
http://twistedmatrix.com/trac/wiki/TwistedConch

And as an extension, Crossbar.io has a development features based on
Manhole that lets you log into a live running Crossbar.io node in a SSH
terminal session! Which is kinda neat;) Because you can then peek and
poke around while the node is running. So yeah, there you also have an
interactive user session and a background WAMP session running in the
same program.

I’m not sure … is that similar to what you have now solved for your
situation?

Cheers,

/Tobias

Am 25.05.2016 um 17:56 schrieb Dave Barndt:

Yes, it appears to be possible. I had a bug in my code and now I’m able to

invoke the editor. Sorry for the distraction.

On Wednesday, May 25, 2016 at 11:42:06 AM UTC-4, Dave Barndt wrote:

Hi,

Is it possible to create a single Autobahn(Python) component that allows

terminal I/O on the frontend and interacts with a router and other WAMP

components on the backend?

I’d like to start the component from the terminal command line, create the

WAMP session, invoke an editor (ex. vim) in the component’s onJoin()

method, then send notifications to other components upon exiting the editor

(according to any changes made).

I’m using Twisted and since it appears to take over sys.stdout I’m not

sure this is possible?

Thanks for any answers/tips!

Dave

0 Likes