Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process ordering #174

Merged
merged 4 commits into from
Oct 16, 2016
Merged

Process ordering #174

merged 4 commits into from
Oct 16, 2016

Conversation

gnufied
Copy link
Contributor

@gnufied gnufied commented Oct 14, 2016

Implement support for adding index to processes such that they can be started in specific order.

@gnufied
Copy link
Contributor Author

gnufied commented Oct 14, 2016

@iffyuva can you have a look?

@iffyuva
Copy link
Member

iffyuva commented Oct 14, 2016

@gnufied i looked at this PR today morning, and PR looks good. only concern is backward compatibility. let me try out this branch for couple of projects, and i will let you know. thanks.

@gnufied
Copy link
Contributor Author

gnufied commented Oct 14, 2016

I think it should be 100% backward compatible, the only change that users not using this feature will see is - 1s delay between starting their processes. I added that because, sometimes when processes are dependent - it is a good idea to introduce some delay between starting them. But we can probably drop it too.

@nisanthchunduru
Copy link
Contributor

Just curious. Can two processes have the same index?

[postgres]
directory = /Users/nisanth/code/SupportBee-Rails
command = /Users/nisanth/.pgvm/environments/current/bin/postgres -D /usr/local/var/postgres
index = 1

[redis]
directory = /Users/nisanth/builds/redis-2.4.2/src
command = ./redis-server /usr/local/etc/redis.conf
index = 1

[rails]
directory = /Users/nisanth/code/SupportBee-Rails
; Depends on redis and postgres
command = bundle exec rails s
index = 2

@gnufied
Copy link
Contributor Author

gnufied commented Oct 14, 2016

Yeah they can, in which case they would be ordered by order in which they were parsed. In fact if a process has to no index, currently it is assigned 0 index.

@gnufied
Copy link
Contributor Author

gnufied commented Oct 14, 2016

It may be worth assigning higher index for processes without explicit index, rather than 0. @nisanth074 what you think?

@nisanthchunduru
Copy link
Contributor

@gnufied If I add a process which doesn't depend on anything else

[postgres]
directory = /Users/nisanth/code/SupportBee-Rails
command = /Users/nisanth/.pgvm/environments/current/bin/postgres -D /usr/local/var/postgres
index = 1

[redis]
directory = /Users/nisanth/builds/redis-2.4.2/src
command = ./redis-server /usr/local/etc/redis.conf
index = 1

[rails]
directory = /Users/nisanth/code/SupportBee-Rails
; Depends on redis and postgres
command = bundle exec rails s
index = 2

[faye]
directory = /Users/nisanth/code/SupportBee-Rails
; We used to use faye for push events
; I'd intuitively expect faye to be started immediately
command = bundle exec faye

I'd intuitively expect the process to be started immediately. Hence I feel defaulting to 0 index for processes without explicit index is fine.

@iffyuva iffyuva merged commit beb471d into master Oct 16, 2016
@iffyuva iffyuva deleted the process-ordering branch October 16, 2016 07:30
@iffyuva
Copy link
Member

iffyuva commented Oct 16, 2016

couple of things to discuss:

  • index can be implicit, ie order in which processes appear in ini file is the order in which we can assign an index, and start processes
  • should invoker list show index of process?

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

Successfully merging this pull request may close these issues.

None yet

3 participants