-
Notifications
You must be signed in to change notification settings - Fork 1
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
Parallel demo #32
Parallel demo #32
Conversation
for more information, see https://pre-commit.ci
demo/parallel_script.py
Outdated
def run(self, number_of_jobs: int, repeats: List[int]): | ||
"""The main (outer) iteration run on the central managing process.""" | ||
|
||
if self.started: | ||
return | ||
|
||
self.started = True | ||
|
||
PORT = find_free_port() | ||
|
||
# Start the server in a new thread | ||
server_thread = threading.Thread(target=self.run_server, args=[PORT]) | ||
server_thread.daemon = True | ||
server_thread.start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to move the PORT related stuff to an argument of this function? Such that the run
command only does parallel dispatch of some operation with some map of input arguments (which can also include the port info)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better yet make it more generic to only receive the URL at which to make the post request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Now the process "server" and HTTP "client" are run in parallel and communicate to each other through the URL provided to the former.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also trying out the kwargs approach discussed yesterday. Let me know if this makes sense.
It's a bit more cumbersome than I'd anticipated because all kwargs are considered required to be defined on the callback function (or simply **kwargs
)
…m_publisher into parallel-tests
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I'm only running the parallel demo in Python at the moment. But I can adapt the main HTML demo to handle both at the same time if that is desirable. |
I'd hold off for a little bit on this while I think of a better way to design the tqdm injection, now that I understand the scoping better |
Got it. Sounds good! |
@garrettmflynn Replaced by #51? |
Yep! Feel free to close |
This PR approaches #31 by including a
demo/parallel_script.py
script (and associated CLI command) that allows you to get updates from paralleltqdm_publisher
instances through an HTTP relay server.@CodyCBakerPhD Let me know if this aligns with what we can bring to this package's dependents. I'll integrate the script into the main demo if that's the case.