inaka / worker_pool

Erlang worker pool
https://hex.pm/packages/worker_pool
Apache License 2.0
276 stars 80 forks source link

Minor fixes to accomodate deprecation warnings in OTP 19.0 #71

Closed wk8 closed 8 years ago

wk8 commented 8 years ago

Fixing the following compilation warnings under OTP 19.0:

src/wpool_pool.erl:371: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
src/wpool_pool.erl:391: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
src/wpool_pool.erl:479: random:seed/1: the 'random' module is deprecated; use the 'rand' module instead
src/wpool_pool.erl:480: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead
wk8 commented 8 years ago

I don't seem to be able to access the logs from failed checks, but I imagine they try to compile with an older version of erlang?

elbrujohalcon commented 8 years ago

@wk8 the server seems to be down (judging by enomem). We'll check, soon.

elbrujohalcon commented 8 years ago

@wk8 Your PR reminded me of a change we implemented before to deal with something related to this warnings (i.e. the wpool_pool:rnd/1 and associated functions). Our goal was to let users compile/use wpool in OTP < 18 (using random) and OTP ≥ 18 (using rand). Your PR showed that change was only half-done, I fixed that in #72 and I finally removed the warnings (with a different approach) in #73. As you can see: I'm not particularly friend of macros and platform definitions. I'm closing this PR since the problem is solved. Feel free to reopen it if you disagree.

wk8 commented 8 years ago

Works with me, thanks!