uqfoundation / pathos

parallel graph management and execution in heterogeneous computing
http://pathos.rtfd.io
Other
1.38k stars 89 forks source link

Lets add "__exit__" for ProcessPool #208

Closed levkovalenko closed 1 year ago

levkovalenko commented 3 years ago

Hi guys, i use your lib in my project and noticed that ProcessPool doesn't close after "with" construction. \ So I started research this problem ans found that methods ___enter__ and __exit__ are empty. Proof: __enter__, __exit__

Moreover I found __exit__ method in ProcessPool, but it was commented about 8 years ago by @mmckerns.

I believe that its time has come. So can i uncomment it and make pool request with this changes?

mmckerns commented 3 years ago

I'm not sure why the implementation is as it is. Hmm. I'd have to look into it. Feel free to uncomment it, and make a pull request. You'll want to add tests to make sure that it behaves as expected.

mmckerns commented 3 years ago

@levkovalenko: I believe I remember why the exit method was commented out. It was because pools in pathos persist beyond the close, and can be reopened and restarted. So, I felt that leaving a context shouldn't shut them down. I'm taking a look at making changes to this behavior.

mmckerns commented 1 year ago

closing as duplicate of #8