October 2018
Intermediate to advanced
420 pages
10h 26m
English
The timestamp operator adds a timestamp to each item emitted. The following figure shows the marble diagram of this operator:

Its prototype is the following:
Observable.timestamp(self, scheduler=None)
An alternative scheduler can be provided with the scheduler parameter. If no scheduler parameter is provided, then the timeout scheduler is used.
Here is an example of the timestamp scheduler:
numbers = Subject()numbers.timestamp().subscribe( on_next = lambda i: print("on_next {}: {}".format(i.value, i.timestamp)), on_error = lambda e: print("on_error: {}".format(e)), on_completed = lambda: ...Read now
Unlock full access