package terminal

import (
	"github.com/gliderlabs/ssh"
	"io"
)

type Process interface {
	Pipe() io.ReadWriter
	Kill() error
	Wait() error
}

// A function definition used to start processes
type Spawner func(sshSession ssh.Session, env []string, name string, arg ...string) (Process, error)

func (s Spawner) Start(sshSession ssh.Session, env []string, name string, arg ...string) (Process, error) {
	return s(sshSession, env, name, arg...)
}