iilyak commented on a change in pull request #3766:
URL: https://github.com/apache/couchdb/pull/3766#discussion_r767745235



##########
File path: src/smoosh/src/smoosh_channel.erl
##########
@@ -65,71 +64,82 @@ close(ServerRef) ->
 flush(ServerRef) ->
     gen_server:call(ServerRef, flush).
 
+is_key(ServerRef, Key) ->
+    gen_server:call(ServerRef, {is_key, Key}).
+
 % gen_server functions.
 
 init(Name) ->
     schedule_unpause(),
     erlang:send_after(60 * 1000, self(), check_window),
-    {ok, #state{name = Name}}.
+    process_flag(trap_exit, true),
+    Queue = smoosh_priority_queue:new(Name),
+    State = #state{name=Name, waiting=Queue},
+    State1 = maybe_recover_state(State),

Review comment:
       We could start in paused state (`State#state{paused=true}`). Send cast 
`gen_server:cast(self(), init)`. In `handle_cast(init, ...` we would recover 
state and return `State#state{paused=false}`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to