ruby / xmlrpc

The Ruby standard library package 'xmlrpc'
Other
37 stars 26 forks source link

Use Array#each instead of while and Array#shift #12

Closed herwinw closed 7 years ago

rhenium commented 7 years ago

[I suppose Array#shift was used instead of Array#each here because the array threads could be modified during iteration from other threads, though xmlrpc doesn't seem to do that.]

As far as I can see assert_join_threads is used only by TestXMLRPC::WEBrick_Testing#with_server in test/webrick_testing.rb, which doesn't appear to need to spawn threads at all. Perhaps it makes more sense to try to remove this assert_join_threads entirely?

herwinw commented 7 years ago

As far as I can see assert_join_threads is used only by TestXMLRPC::WEBrick_Testing#with_server in test/webrick_testing.rb, which doesn't appear to need to spawn threads at all.

I'm not completely sure about that, we need something to run the server and something to run the client. But I only had a short look at it.

@hsbt Hold your merge horses :) I'll have a better look at this later.

herwinw commented 7 years ago

Looks like @rhenium was right: we do need some threads, but not the ones we used here. This cleans up the code a bit.

rhenium commented 7 years ago

:+1: Looks good to me!

hsbt commented 7 years ago

@herwinw @rhenium Thank you! It simplefied test suite in xmlrpc.