Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

blocking support #14

Closed
dpickett opened this issue Sep 15, 2010 · 5 comments
Closed

blocking support #14

dpickett opened this issue Sep 15, 2010 · 5 comments

Comments

@dpickett
Copy link

I have a number of tabs that are dependent on the completion of a set of commands in tab 1 (a git pull and a rake db:migrate, for example). It would be great if I could have the other tabs wait for the completion of every command in tab 1.

I'd be happy to build this out, but I wasn't sure if you had a design strategy in mind.

@KieranP
Copy link

KieranP commented Sep 20, 2010

Agreed! I need tab one to authenticate a disk image, which takes input. Then after that, I need two other tabs to open up, but only once authenticated. So it needs the ability to call tabs within the commands, and delay tabs from loading. e.g.

- tab1:
  - [run disk image auth]
  - tab2 && tab3
- tab2_delayed:
  - resque-start
- tab3_delayed:
  - script/server

@KieranP
Copy link

KieranP commented Oct 1, 2010

Any chance of this now that the Ruby syntax is available?
Should make it easier to implement?

Here is how I see it working:

window {
  tab :background_server {
    run "script/bgrb"
    open(:app_server)
  }
  tab :app_server, :auto_open => false {
    run "script/server"
  }
}

In this case, app_server would not be run right away. background_server would start, complete, then start the app_server tab.

@achiurizo
Copy link
Owner

This sounds like a good idea for rake tasks and such. However my question is how will the tab know the command is competed? in some cases, say i have a 'script/server' running, that terminal will hang. I was thinking a possible solution could be something like:

run "rake db:migrate", :wait => 10.seconds

Any ideas or suggestions?

@dpickett your more than welcome to build it out. help is always appreciated =)

@KieranP
Copy link

KieranP commented Dec 5, 2010

If the tab hangs, then it's not an issue. Anything successful will return 0 status code.

So for a chain of commands, you can do:

cd .... && then_this && then_that

If anything fails, then it'll stop like it should.

So if you wanted to migrate then start the server, you'd use:

window {
  tab :rails_app {
    run "rake db:migrate"
    run "script/server"
  }
}

That would do something like:

rake db:migrate && script/server

Does that make sense?

@achiurizo
Copy link
Owner

hey KieranP, yes that does make sense, thanks =). I'll have to add the tab block feature, but i do have your mentioned chain feature here: 6fb856d

so you could do this:
run 'who','whoami','ls'
which would translate that to:
"who && whoami && ls"
if you don't want them to chain, you'll just declare a command per run as normal.

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

No branches or pull requests

3 participants