Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Non-blocking Calls #8

Open
kennethreitz opened this issue Sep 24, 2011 · 2 comments
Open

Non-blocking Calls #8

kennethreitz opened this issue Sep 24, 2011 · 2 comments

Comments

@kennethreitz
Copy link
Contributor

Envoy needs to provide a way to pawn and interface with long-running processes.

Use case: sshout

Functionality

  • Non-blocking
  • Stream
  • Readline-style reactors?
c = envoy.connect('command')

# Expect.
c.expect('Password: ')
c.sendline('mypassword')

# Pid
c.pid

# Kill.
c.kill()

# Block.
c.block()
@kennethreitz
Copy link
Contributor Author

Optional context manager:

with envoy.connect('long-process') as c:
    print c.pid

# Process is killed when context manager exits.

@kennethreitz
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant