aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Linares <matias@deprecated.org>2018-09-08 12:46:03 -0300
committerMatias Linares <matias@deprecated.org>2018-09-08 12:46:03 -0300
commitb0643e39808930d2ea5a04f1a35e9b1e14e06861 (patch)
tree98861020330e1b67545a5dc529228be75a7ac555
parentee13d9e117fd82cf88c9bf28d6ce19b331aca1cb (diff)
downloadperl6-matrix-client-b0643e39808930d2ea5a04f1a35e9b1e14e06861.tar.gz
Add documentation to run method.
-rw-r--r--docs/client.pod630
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/client.pod6 b/docs/client.pod6
index 6256cde..302e99b 100644
--- a/docs/client.pod6
+++ b/docs/client.pod6
@@ -242,4 +242,34 @@ the servers may choose to implement additional access control for this endpoint.
Uploads a file to the server. It returns the MXC URI to the uploaded content.
+=head2 run
+
+ method run(Int :$sleep = 10, :$sync-filter? --> Supply)
+
+Returns a C<Supply> that emits L<Matrix::Response::StateEvent> with the last
+events. The C<$sleep> parameter is to sleep for that amount of seconds before
+making a L<sync> request again. The C<$sync-filter> is the same parameter that
+will be passed to L<sync> method to filter out the useful events.
+
+This can be useful to turn something like:
+
+ my $since;
+ loop {
+ $response = $client.sync(:$since);
+ $since = $response.next-batch;
+
+ for $response.joined-rooms -> $room {
+ for $room.timeline.event -> $event {
+ # Do something useful with $event
+ }
+ }
+ }
+
+into:
+
+ my $sup = $client.run();
+ react whenever $sup -> $event {
+ # Do something useful with $event
+ }
+
=end pod