Skip to content

Add forks - #230

Closed
Bogdanp wants to merge 4 commits into
masterfrom
add-forks
Closed

Bogdanp wants to merge 4 commits into
masterfrom
add-forks

Conversation

@Bogdanp

@Bogdanp Bogdanp commented Oct 13, 2019

Copy link
Copy Markdown
Owner

No description provided.

Comment thread dramatiq/forks_set.py Outdated
_type_ = c_byte


class ForksSet(Structure):

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bogdanp

Bogdanp commented Oct 13, 2019

Copy link
Copy Markdown
Owner Author

If anyone has a better name for this functionality other than forks/fork functions, I'm all ears. My imagination is failing me at the moment.

@Bogdanp

Bogdanp commented Oct 13, 2019

Copy link
Copy Markdown
Owner Author

Also, if someone with access to a windows machine could give this a try I'd be super grateful.

Steps to try on windows:

  1. clone the repo and checkout this branch
  2. run pip install '.[rabbitmq]' in the root
  3. cd examples/basic
  4. dramatiq example
  5. visit http://127.0.0.1:9191 and make sure the Prometheus exposition server is running

@Bogdanp Bogdanp closed this Oct 16, 2019
@Bogdanp
Bogdanp deleted the add-forks branch October 16, 2019 07:24
@bersace

bersace commented Oct 17, 2019

Copy link
Copy Markdown
Contributor

What do you think of side processes ?

@CaselIT

CaselIT commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

Would you advise using a fork function when using apscheduler to for periodic jobs?
I have not found suggestions in the documentation regarding this, so I was wondering if it was advisable.

Also, if someone with access to a windows machine could give this a try I'd be super grateful.

Steps to try on windows:

1. clone the repo and checkout this branch

2. run `pip install '.[rabbitmq]'` in the root

3. `cd examples/basic`

4. `dramatiq example`

5. visit http://127.0.0.1:9191 and make sure the Prometheus exposition server is running

I bit late, but for what is worth, it does work on windows

@bersace

bersace commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

@CaselIT I think not. I'm maintaining periodiq, and periodiq scheduler must be a single process. Side processes purpose is for all your worker processes (e.g. prometheus exporter).

@CaselIT

CaselIT commented Oct 2, 2020

Copy link
Copy Markdown
Contributor

Well, a fork function creates a new process for each one, so technically it is a single process as far as the scheduler is concerned.

Of course you cannot control it when starting it that was, so for a scheduler that has a cli it maybe not the best way, but apscheduler does not offer one.

@Bogdanp

Bogdanp commented Oct 3, 2020

Copy link
Copy Markdown
Owner Author

@CaselIT the functionality is intended for side-loading code next to workers, so in that sense I think it's appropriate. You just need to be careful if you run multiple sets of workers.

@CaselIT

CaselIT commented Oct 5, 2020

Copy link
Copy Markdown
Contributor

Thanks for the reply. Yes, of course in case of multiple workers only one of them should start the scheduler or multiple jobs could be triggered.

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.

3 participants