U vi~ @sddlmZmZmZmZddlmZmZmZddlm Z ddlmZddl m Z ddl mZedZedZd eeeeeefeeeejeejeeegeeeeeffd d d Zd gZd S))CallableOptionalTypeVarUnion)ConnectableObservable Observableabc) operators)typing ReplaySubject)Mapper_TSource_TResultN)mapper buffer_sizewindow schedulerreturncsL|r4dttjttdfdd }tj||dSt|}tj|dS)a*Returns an observable sequence that is the result of invoking the mapper on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject. Examples: >>> res = replay(buffer_size=3) >>> res = replay(buffer_size=3, window=500) >>> res = replay(None, 3, 500) >>> res = replay(lambda x: x.take(6).repeat(), 3, 500) Args: mapper: [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. buffer_size: [Optional] Maximum element count of the replay buffer. window: [Optional] Maximum time length of the replay buffer. scheduler: [Optional] Scheduler the observers are invoked on. Returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a mapper function. N)rrcs t|S)Nr )rrrL/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_replay.pysubject_factory6sz replay_..subject_factory)rr)subject)N)rr SchedulerBaser ropsZ multicast)rrrrrrsrrrreplay_ s' r)NNNN)r rrrrZ reactivexrrrr rZreactivex.subjectr Zreactivex.typingr rrintZ RelativeTimerr__all__rrrrs*     3