- operator:
distinct_until_changed
only require the value implementPartialEq
notEq
. - operator:
group_by
should not subscribe to value source anew on each new group
- Change to Rust stable by
GAT
is stabilized. - operator: add
throttle
operator.
- operator: Delete 'ThrottleTimeEdge' and 'ThrottleTimeOp'. Change the logic of function 'throttle_time()' to use 'throttle()'.
- operator: fix unsubscribe
merge_all
but the inner observable not unsubscribe.
- wasm support: support target
wasm32-unknown-unknown
and featurewasm-scheduler
. - operator: add
start_with
operator. - operator: add
start
operator. - operator: add
distinct_until_changed
operator. - operator: add
distinct_key
operator. - operator: add
distinct_key_until_changed
operator. - operator: add
pairwise
operator. - operator: add
tap
operator.
- operator: Re-implement
with_latest_from
, so that two operands don't require one shared observer at the same time anymore.
- operator: add
with_latest_from
operator.
- subject: subject emit buffer crash, borrow buffer only when pop value.
This is a big refactor version, Subscriber
has been removed, LocalObservable
and SharedObservable
has direct to accept Observer
instead of Subscriber
. Provide SingleSubscription
ProxySubscription
and MultiSubscription
to use, so we can choose the most suitable and efficient type when implementing operator. A macro named impl_local_shared_both
help implement local & shared version at once. And nightly rust required before GAT
stable.
- operator: add
skip_until
operator. - operator: add
combine_latest
operator.
- observer: remove
Observer::is_stopped
method. Subscriber
removed.- The
LocalObservable
andSharedObservable
now acceptObserver
instead ofSubscriber
- operator: fix #160,
FlattenOp
not support chainBoxOp
because unnecessary bounds toObservable::Unsub
.
- operator: add
group_by
operator. - operator: add
buffer_with_count
,buffer_with_time
andbuffer_with_count_and_time
operator.
- operator: add
timer
andtimer_at
operator. - subject: add
BehaviorSubject
subject. - operator: add
merge_all
operator.
- tooling: Make runnable on rust stable by
- Removing declarative macros
- Using bencher lib instead of nightly
test::Bencher
- Remove use of drain_filter
- Remove InnerDeref using GAT
- Subject remove factory method
Subject::new
and replace withLocalSubject::new
as well asSharedSubject::new
- operator: add
flatten
operator.
- SharedObservable: rename
SharedObservable::to_shared
asSharedObservable::into_shared
- operator: add
element_at
operator. - operator: add
ignore_elements
operator. - operator: add
all
operator. - operator: add
contains
operator.
- operator:
skip_last
should emit not only when observer complete. - operator: make
first_or
implement withfirst
anddefault_if_empty
- operator: make
last_or
implement withlast
anddefault_if_empty
- operator: make
ignore_elements
implement withfilter
- make
interval
mod public.
- operator: add
distinct
operator. - operator: add
debounce
operator. - subject: export
LocalSubjectRef
,LocalSubjectErrRef
andLocalSubjectRefAll
.
Observer
trait now use associated type replace generic type.
0.9.1 (2020-08-25)
- operator: export
filter_map
inObservable
.
0.9.0 (2020-08-22)
- operator: add
map_to
operator. - operator: add
finalize
operator. - subscription: Add
SubscriptionGuard::new()
for enabling RAII for existing subscriptions. - subscription: Add
SubscriptionWrapper::into_inner()
, e.g. if one wants to add the inner subscription to a composite subscription. - scheduler: Add two trait
SharedScheduler
andLocalScheduler
to implement custom Scheduler. - scheduler:
LocalPool
andThreadPool
infutures::executor
can directly use as scheduler. - scheduler:
tokio::runtime::Runtime
also supported, but need enable the featurefutures-scheduler
. - observer: add a
is_stopped
method forObserver
to detect if emit completed.
- scheduler: Use the runtime of future as the scheduler, and the default scheduler has be removed.
- operator:
observer_on
not really emit value from immediate observable likeobservable::of
.
- scheduler:
Schedulers
has been removed. - observable: don't require items/errors to implement
PayloadCopy
,Clone
is enough now (removePayloadCopy
) - observable:
observable::from_future
andobservable::interval
need givescheduler
parameter. - operator:
delay
,observer_on
andsubscribe_on
need givescheduler
parameter. - subscription: remove method
inner_addr
inSubscriptionLike
. - subject remove
MutRefSubject
.
0.8.3 (2020-03-26)
- operator:
sample
support clone, and not require source observer and sample observable return same subscription.
0.8.2 (2020-03-25)
operator: add some explicit bounds on operators method to improve type infer, and some code use map
may not compile, if it's just map
and never subscribe.
Subject: MutRefSubject now mark as unsafe.
- operator: remove unnecessary lifetime bounds on
box_it
operator.
- subscription The guard returned by
unsubscribe_when_dropped()
has the must_use attribute - operator: add
zip
operator. - operator: add
take_until
operator. - operator: add
take_while
operator. - operator: add
share
operator. - operator: add
default_if_empty
operator. - observer: add support for items/errors that don't implement
Copy
(by implementingPayloadCopy
) - observable: add macros
of_sequence
that producing values from a custom sequence. - subject: add
subscribed_size
method on Subject.
0.8.1 (2020-02-28)
- docs: fix docs link and remove inner macro from docs.
0.8.0 (2020-02-28)
- operator: add
box_it
operator to box observable. - operator: add
skip
operator. - operator: add
skip_last
operator. - operator: add
take_last
operator. - subscription The return value of
subscribe
,subscribe_err
,subscribe_complete
andsubscribe_all
now provides a methodunsubscribe_when_dropped()
which activates "RAII" behavior for this subscription. That meansunsubscribe()
will be called automatically as soon as the value returned byunsubscribe_when_dropped()
goes out of scope. If you don't assign the return value to a variable,unsubscribe()
is called immediately!
- observable: Operators as provided methods on Observable instead of extension traits.
- observable: Every observable creation function has a concrete type, not only use a LocalObservable struct to wrap all,
- observable rename
RawSubscribable
toLocalObservable
-
operator: all operator extension traits are removed.
-
observable: remove
Observable::new
, and add a samecreate
function inobservable
to replace it. -
observable: Rename
Observable
toObservableFromFn
. -
operator: Remove
IntoShared
trait. -
operator: Use
Clone
replaceFork
, now just callobservable.clone()
replaceobservable.fork
. -
subject: merge
Subject::local
andSubject::new
intoSubject::new
. -
subject: For now, LocalSubject emit value by mut ref must explicit call
mut_ref_all
,mut_ref_item
andmut_ref_err
. For example:let subject = Subject::new().mut_ref_item().subscribe(|_|{}); subject.next(&mut 1);
-
observable: rename observable creation function
from_fn
toof_fn
-
observable: rename observable creation function
from_future_with_err
tofrom_future_result
-
observable: Redefine
RawSubscribable
asLocalObservable
. Frompub trait RawSubscribable<Subscriber> { type Unsub: SubscriptionLike + 'static; fn raw_subscribe(self, subscriber: Subscriber) -> Self::Unsub; }
to
pub trait LocalObservable<'a> { type Item; type Err; type Unsub: SubscriptionLike + 'static; fn actual_subscribe<O: Observer<Self::Item, Self::Err> + 'a> ( self, subscriber: Subscriber<O, LocalSubscription>, ) -> Self::Unsub; }
0.7.2 (2020-01-09)
- Subject: merge four version local subject into same version.
- Subject:
Subject::local
,Subject::local_mut_ref
,Subject::local_mut_ref_item
andSubject::local_mut_ref_err
merge intoSubject::local
.
0.7.1 (2019-12-12)
Nothing changed, just fix release package
0.7.0 (2019-12-12)
- Subject: local subject support emit mut ref item.
- observable:
LocalConnectableObservable
andSharedConnectableObservable
has merged intoConnectableObservable
- observable: remove generic type
Item
andErr
fromRawSubscribable
, almost not effect user code.
0.6.0 (2019-12-07)
- observer:
Observer::next
emit items by value instead of reference. - operator: remove
map_return_ref
operator, nowmap
cover its use scenes. - operator: remove
filter_map_return_ref
, nowfilter_map
cover its use scenes.
0.5.0 (2019-11-19)
- operator: add
scan
operator. - observable: add trivial
throw
,empty
,never
andrepeat
observables. - operator: add
last
andlast_or
operators. - operator: add
reduce
andreduce_initial
operators. - operator: add
sum
,min
,max
,count
andaverage
math/aggregate operators. - operator: add
filter_map
andfilter_map_return_ref
observables.
- operator: fix the compiler complain when
map
operator convert source type to a different one.
- observable: macros
of!
,empty!
,from_iter!
,from_future!
andfrom_future_with_err!
replaced by functions.
0.4.0 (2019-11-07)
- observable: add
ConnectableObservable
to support multicast. - operator: add
throttle_time
operator - operator: add
publish
operator - operator: add
ref_count
operator - Subject: support
Fork
even ifItem
andErr
not supportClone
.
Scheduler: add a delay
param for schedule
method, from
pub trait Scheduler {
fn schedule<T: Send + Sync + 'static>(
&self,
task: impl FnOnce(SharedSubscription, T) + Send + 'static,
state: T,
) -> SharedSubscription;
}
to
pub trait Scheduler {
fn schedule<T: Send + 'static>(
&self,
task: impl FnOnce(SharedSubscription, T) + Send + 'static,
delay: Option<Duration>,
state: T,
) -> SharedSubscription;
}
0.3.0 (2019-10-12)
In v0.2
we implemented all operators and observable thread safe, so we can pass task across threads by schedulers. In this way, all user provide closure must satisfied Send + Sync + 'static
, even never use scheduler and multi-thread.
For now, we removed the bounds Sync
, Send
and 'static
, and add a new trait IntoShared
. We always implemented operator for local thread, and implement IntoShared
for it to convert it to a thread-safe operator.
By default, RxRust always use single thread version to get the best performance, and use IntoShared
to convert a local object to a thread-safe object if we need pass this object in threads.
Before:
let res = Arc::new(Mutex(0));
let c_res = res.clone();
observable::of(100).subscribe(|v| { *res.lock().unwrap() = *v });
assert_eq!(*res.lock().unwrap(), 100);
After:
let mut res = 0;
observable::of(100).subscribe(|v| { res = *v });
assert_eq!(res, 100);
- removed
RxFn
andRxValue
- operators: removed
Multicast
- observable: removed
ObservableOnce
- observable:
observable::from_vec
andobservable::from_range
functions merge toobservable::from_iter!
macro. - observable:
observable::empty
function toobservable::empty!
macro. - observable:
observable::of
function toobservable::of!
macro. - observable:
observable::from_future
function toobservable::from_future!
macro - observable:
observable::from_future_with_err
function toobservable::from_future_with_err!
macro - observable:
observable::interval
function toobservable::interval!
macro
- observe_on: unsubscribe should also cancel dispatched message.
- subscribe_on: unsubscribe should also cancel task in scheduler queue.
0.2.0 (2019-09-02)
- observable: add
observable::from_vec
andobservable::from_range
- observable: add
observable::empty
andobservable::of
- observable: add
observable::from_future
andobservable::from_future_with_err
- observable: add
observable::interval
- operator: add
delay
operator - operator: add
filter
operator - operator: add
first
operator - operator: add
multicast
andfork
operator,multicast
andfork
are special operators in rxrust, that because in rxrust all operators both consume the upstream, so the are unicast,multicast
let you can convert an unicast stream to a multicast stream to supportfork
stream from it. - operator: add
map
operator - operator: add
merge
operator - operator: add
observe_on
operator - operator: add
subscribe_on
operator - operator: add
take
operator - Schedulers: add
Schedulers::Sync
implementation - Schedulers: add
Schedulers::NewThread
implementation - Schedulers: add
Schedulers::ThreadPool
implementation