emqx / ecpool

Erlang Connection/Client Pool Library
MIT License
30 stars 20 forks source link

Only works in Emqtt #5

Closed Ryanauger95 closed 7 years ago

Ryanauger95 commented 7 years ago

Hi,

I wrote a plugin for emqtt that uses ecpool and it works great. Unfortunately, however, it will not work in any standard vm.

Even when only working with Ecpool, regardless of plugins, it will not work outside of emqtt. I download, make, and run erl -pa ebin/ in the ecpool directory, commands such as ecpool:start_pool(poolid, pool_mod, []) do not work, and I receive the error:

exception exit: {shutdown,{failed_to_start_child,pool,
                                                    {noproc,{gen_server,call,
                                                                        [gproc_pool,
                                                                         {new,{ecpool,poolid},random,[{size,4}]}]}}}}

I assume this has to do with some setup that is done in emqtt. Do you happen to know what setup needs to take place in order to use ecpool outside of emqtt?

Thanks,

Ryanauger95 commented 7 years ago

Problem is that ecpool requires gproc to be running. Solution: application:start(gproc), application:start(ecpool).