[det]redis_subscribe(+Redis,
+Channels, -Id, +Options)redis(Id, Channel, Data)
If redis_unsubscribe/2 removes the last subscription, the thread terminates.
To simply print the incomming messages use e.g.
?- listen(redis(_, Channel, Data),
format('Channel ~p got ~p~n', [Channel,Data])).
true.
?- redis_subscribe(default, test, Id, []).
Id = redis_pubsub_3,
?- redis(publish(test, "Hello world")).
Channel test got "Hello world"
1
true.
| Id | is the thread identifier of the listening
thread. Note that the Options alias(Name) can be
used to get a system wide name. |