inaka / worker_pool

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

can_not_hold_a_reply error for handle_call with {noreply, State} result #78

Closed brigadier closed 7 years ago

brigadier commented 8 years ago

At the moment wpool does not work with gen_servers which return {noreply, State} in handle_call. Am I right that nothing is going to be broken in wpool If I change {stop, can_not_hold_a_reply, State#state{state = NewState}}; to {reply, queued, State#state{state = NewState}}; in the wpool_process.erl? From the first look everything is ok. I'm going to use this for semi-asynchronous sockets - successfuly sending of request will be acknowledged with {noreply, State} result of gen_server:call(), and actual reply to the transacton will be sent late with gen_server:reply().

elbrujohalcon commented 8 years ago

@brigadier I'm not entirely sure, but feel free to give it a try and let us know how that goes

ElectronicRU commented 7 years ago

Actually, the can_not_hold_a_reply error doesn't make much sense: the server answers anyway with the same gen_server:reply mechanism, so properly handling {noreply, State} would be entirely possible.