"Subscribers are removed from the channel as soon as the first message is delivered, so to keep a subscription active you need to keep re-subscribing using the returned Timestamp as the input to the next call."
On Monday, 15 December 2014 20:31:48 UTC, [email protected] wrote: > > Hi, playing with tinymq here. I have a very simple gen_server which > subscribes on initialisation as follows: > > init([]) -> > tinymq:subscribe(?MODULE, now, self()), > {ok, #state{}}. > > modified handle_info to dump any messages received (I'm assuming they > appear at the handle_info level): > > handle_info(Info, State) -> > io:format("handle_info: ~w~n", [Info]), > {noreply, State}. > > then finally added a top- level function to push messages onto the queue: > > send(Msg) -> > tinymq:push(?MODULE, {msg, Msg}). > > Now this works fine for the first message I send; message dumped to > console by handle_info; but after that no other pushed messages are dumped. > > Have I misunderstood how the tinymq subscribe API works ? Do I have to > flush queues somewhere ? > > TIA > -- You received this message because you are subscribed to the Google Groups "ChicagoBoss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/group/chicagoboss. To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/2743b740-ed55-46b6-bee2-6e3fc526f374%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
