U vi@s`ddlmZmZmZmZddlmZmZedZe eeegeeefdddZ dgZ dS))CallableListOptionalTypeVar) Observableabc_T)countreturncs$tttttdfdd }|S)N)sourcer cs4dtjttttjtjdfdd }t|S)aReturns an array with the specified number of contiguous elements from the end of an observable sequence. Example: >>> res = take_last(source) This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. Args: source: Source observable to take elements from. Returns: An observable sequence containing a single list with the specified number of elements from the end of the source sequence. N)observer schedulerr csDgtddfdd }ddfdd }j|j||dS)N)xr c s6j&|tkr(dW5QRXdS)Nr)lockappendlenpop)r)r qr T/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_takelastbuffer.pyon_next$s  zOtake_last_buffer_..take_last_buffer..subscribe..on_next)r csdS)N)r on_completedrr rrrr*s zTtake_last_buffer_..take_last_buffer..subscribe..on_completed)r )r subscribeZon_error)r r rr)r r rrrsz>take_last_buffer_..take_last_buffer..subscribe)N)rZ ObserverBaserrrZ SchedulerBaseZDisposableBaser)r rr )r rtake_last_buffer s z+take_last_buffer_..take_last_buffer)rrr)r rrrrtake_last_buffer_s +rN) typingrrrrZ reactivexrrrintr__all__rrrrs&/