c#,system.reactive,reactive-programming
I am replacing some of my previously written code with reactive extensions. Previously I was using File.ReadAllLines(FileName) and then loop through all the lines of files and in this loop at some point, I break from the loop and perform some operation on the processed records(which now I want to...

c#,system.reactive,reactive-programming,sodium
How can the television channel problem as explained in this talk at 31th minute be solved by RX ? The problem expressed in Rx is as follows: The are two television channels (channel1 and channel2) which transmit a stream of images, plus a stream of fuzz which represents no channel...

java,couchbase,reactive-programming,rx-java
The new Couchbase SDK makes bulk operations easier to use and more performant use rx-java. But is there any value to using rx for operations on single values? If we look at a simple CAS / insert operation, ie if the value exists do a cas else do an insert...

reactive-programming,reactive-cocoa
I was wondering what the approach for checking for nil values with reactive cocoa is. I would assume I could create a signal like so. // Turn state check into a signal to activate the rest RACSignal* modelSignal = [self checkIfModelIsValid:self.model]; [[modelSignal then:^RACSignal *{ return [self obtainImageSignal]; // Always need...

javascript,reactjs,reactive-programming
I'm creating a form in react that has conditional flow. For example two input fields might be hidden when some select option is chosen. Is it a good idea to create states based on the select options and make the visibility of the input elements to depend on the current...

java,monads,reactive-programming,rx-java
I am starting to embrace reactive programming a bit more, and I'm trying to apply it to my typical business problems. One pattern I often design with is database-driven classes. I have some defined unit class like ActionProfile whose instances are managed by an ActionProfileManager, which creates the instances off...

javascript,html5,reactjs,reactive-programming
I am using React JS for Rendering the HTML content. The issue is I am not able to understand particular section of code what it does. If you can see a basic sample of a Todo List from the below link http://facebook.github.io/react/ <script type='text/jsx'> /** @jsx React.DOM */ var TodoList...

retrofit,reactive-programming,rx-java,okhttp
I have rest api. @Get("/serveraction") public Observable<String> myRequest(@Query("Data") String data); I know, that okhttp has canceling functionality(by request object, by tag), but don't know how use it with retrofit and rxjava. What is the best way to realize canceling mechanism for network tasks with retrofit and rxjava?...

java,android,reactive-programming,rx-java,rx-android
How can I retrieve the latest value from BehaviorSubject on RxAndroid? Some background info: I'm using RxJava to implement MVVM pattern. My ViewModel encapsulates "bindable properties" that are BehaviorSubjects. I'm binding them to UI elements as observables, ensuring that the interface gets constantly updated (and thanks to using BehaviorSubject, it's...

android,pagination,reactive-programming,rx-java
I'm almost sold to RxJava, which is a perfect companion to Retrofit, but I'm struggling into a common pattern while migrating my code: to save bandwidth, I'd like to lazily fetch (paginated) objects from my webservice as needed, while my listview (or recyclerview) is scrolling using reactive programming. My previous...

javascript,reactive-programming,rxjs,bacon.js
For fun and to learn I'm trying to implement an undo system in my app using functional reactive programming. I have a stream of state changes, which need to be saved onto the undo stack. When the user clicks undo, I take a value from the stack and update application...

reactive-programming,rx-java
To be precise, here is an simple example(In real world, both observables are long running task): Observable<String> city = Observable.just("Moscow"); //here i get hashcode based on result from city Observable<Integer> hashCodeFromCity = city.flatMap( new Func1<String, Observable<Integer>>() { @Override public Observable<Integer> call(String s) { return Observable.just(s.hashCode()); } }); hashCodeFromCity.subscribe(new Action1<Integer>() {...

reactive-programming,rx-java,rxjs
Here is a picture of what I am attempting to accomplish. --a-b-c-a--bbb--a split into --a-----a-------a --> a stream ----b------bbb--- --> b stream ------c---------- --> c stream Then, be able to a.subscribe() b.subscribe() c.subscribe() So far, everything I have found has split the stream using a groupBy(), but then collapsed everything...

c#,.net,system.reactive,reactive-programming
I have an intensive Java background so forgive me if I'm overlooking something obvious in C#, but my research is getting me nowhere. I am trying to use the reactive Rx .NET library. The compiler is not complaining about the IObservable but it is with the call to the zip...

c#,.net,reactive-programming
I have a hard time to figure out how the SequenceEqual works in Reactive Extensions version 2.2.5 Below is the code var subject1 = new Subject<int>(); var subject2 = new Subject<int>(); IObservable<bool> sequenceEqual = subject1.SequenceEqual(subject2); subject1.OnNext(5); subject1.OnNext(3); subject2.OnNext(1); subject2.OnNext(4); //This will be notified if the two sequences completed sequenceEqual.Subscribe(b =>...

reactive-programming,rx-java
I'm trying to create a task that will on a regular basis query my database write all the results in an other state and i'd like to do this using RxJava. I'm using RxJava-JDBC to query my database. Here's what the code looks like: final Database db = Database.from(url); db...

java,multithreading,asynchronous,reactive-programming,rx-java
I'm messing around with RxJava and I want to stream a thousand consecutive integers. Then I want to asynchronously split them into odd and even streams, and then print them asynchronously. However, I'm getting nothing printed out or at least very partial output. What am I missing? Did I schedule...

reactive-programming,rx-java
I have heard several reactive programming folks say "don't break the monad, just continue it". I see the merit in this. There are still certain instances I'm confused about, especially when the Observable is finally consumed or subscribed to. This is even more confusing when several observables have to be...

java,reactive-programming,rx-java
Java 8 lambda streams have a peek() operator which allows you to execute a void operation on each item. This is typically used for debugging, but it also is a nice way to cheat and kick off a void operation without mapping to something. Is there an equivalent to this...

c#,.net,system.reactive,reactive-programming,rx.net
My system has a lot of status objects - connections status, cpu load, logged users and so on. All of such events are merged into a single observable stream. I want to make a admin utility to show actual status of the system and to show all of that counters....

c#,.net,system.reactive,reactive-programming
I have an event that fires regularly. Let's assume that processing the event takes ~1s. Instead of waiting 1s for each received event I want to accumulate events until the last processing is done. When processing is done I want to proces the event data I received during the last...

java,reactive-programming,rx-java,observable
I have a question about RxJava Observable. For example, I have an Retrofit interface, which returns me Observable. I need to do something with this stream of Video. Here is code for downloading Videos and saving it's into list: API.getVideoListObservable() .doOnError(t -> t.printStackTrace()) .map(r -> r.getObjects()) .doOnNext(l -> VideoActivity.this.runOnUiThread(() ->...

system.reactive,reactive-programming
This class accumulates values + knows at current moment the difference between current sum and sum 1 minute ago. Its client uses it in such way: adds new value for every incoming data chunk and gets the difference. Now, there's a problem with restoring its state. Suppose application gets recycled,...

javascript,meteor,reactive-programming
I am trying to grasp something that I'm sure is pretty basic in meteor, i.e. using reactive calculated values. Here is a simple example of the sort of thing I am trying to acheive. The code doesn't work, but it looks something like what I would expect might work. I...

reactive-programming,rxjs,reactive-streams
Consider I have two streams of data, is there a way to merge them and apply conditions on data between these two streams? For example Stream A : A, B, C, D.... Stream B : -, A, -, -.... Composed : (A,-),(B,A),(C,-),(D,-).... How to get composed stream above using rxjs?...

reactive-programming,rx-java
I have two observables. First - get session from internet or from cache; Observable<SessionKey> getSession = getSessionFromInternetOrCache(); Second - call to server api, using session Observable<MyResult> apiCall = getSession.flatMap(session -> { return myApi.getResult(session); }) Problem, that I have several independent components (gui). They are starting in parallel. apiCall also started...

plot,shiny,reactive-programming,weight
I am filtering a tbale and a heat-map simultaneously. During filtering, the width of the table is changing such that width of particular columns remains the same. Width of the heat-map remains the same during filtering. I want the heat-map to change its weight in the same way as the...

javascript,reactive-programming,rxjs,reactive-extensions-js
Theoretically it should be possible to implement any RxJS operator (except just() and flatMap()) through flatMap(). For instance map() can be implemented as function map(source, selector) { return source.flatMap(x => Rx.Observable.just(selector(x))); } How to implement merge() through flatMap()? (avoiding mergeAll() too, of course)...

java,monads,reactive-programming,rx-java
I learned it is undesirable to use Subjects in reactive programming although I found them highly convenient. But I understand they can be abused. So I tried to create an infinite Observable<ImmutableMap<Integer,ActionProfile> that needs to publish a new ImmutableMapevery time refresh() is called. I also have a forKey() method that...

scala,reactive-programming,rx-java
I'm trying to implement the ObserveLatestOn operator in RxJava (actually, RxScala). This operator is useful, when we've got a fast producer and a slow subscriber, but the subscriber doesn't care about any items lost while it was consuming an item. A marble diagram: --1---2---3----------5------6--7-8-9------| --1=========>3===>---5=======>6======>9==>| The = character represents a...

java,filter,reactive-programming,pair
I'm trying to build a simple application using java reactive extensions. I have two streams that emits temperature values continuously, I want to detect and filter out spikes of sensed temperature that could be errors, for doing so I need to take account of the precedent value too so that...

javascript,html5,design,reactive-programming
I am planning to create a reactive theme for a website. I have looked into some tools like Adobe Animate for producing HTML5 reactive images. I came across the design on the https://www.playframework.com/ website. As you scroll the images change, there's some kind of reactive animation going on. What do...

ios,objective-c,reactive-programming,reactive-cocoa
I'm using ReactiveCocoa in a new iOS app. I'm new to reactive programming so I'm still trying to understand what's the proper way to chain signals. Right now I have the following flow for the "login with Twitter" button. The ALTUserManager class has the following method for managing the whole...

java,android,reactive-programming,rx-java
I'm making an Android interface that shows some data fetched from the network. I want to have it show the latest available data, and to never be empty (unless no data has been fetched at all yet) so I'm using a BehaviorSubject to give subscribers (my UI) the latest available...

javascript,node.js,reactive-programming,rxjs,bacon.js
After learning about Observables, I find them quite similar to NodeJS streams. Both have a mechanism of notifying the consumer whenever new data arrives, an error occurs or there is no more data (EOF). I would love to learn about the conceptual/functional differences between the two. Thanks!...

ios,objective-c,reactive-programming,reactive-cocoa
I am trying to construct a reactive pipeline where a change in some input signals will trigger off an asynchronous web api request. But I do not need to perform anything in the subscribeNext block of the web api. This is how it looks: RACSignal *inputChanged = [[RACSignal merge:@[ RACObserve(self,...

java,reactive-programming
This question already has an answer here: Advantage of Functional Reactive Programming over event-listeners 2 answers How the Reactive Programming differs from calling a function in Event listener (mouse, key), because both are kind of asynchronous event stream so whats the advantage of Reactive over traditional Event listeners calls?...

f#,functional-programming,reactive-programming,observable
I was writing an unit test that verified the events fired from a class. I followed the standard "IEvent<_>, Publish, Trigger inside an FSharp type" pattern. Can you recommend the "functional" way to achieve that? Here are the options I can think of: Convert the event stream into a list...

scala,email,reactive-programming,playframework-2.3
I am using play-framework 2.3.x and scala 2.11.4. When integrate play-mailer for sending and emails from my application, there is nothing happen. In the logs there are no exception produces and no return values are available. Following is email properties: smtp.host = "smtp.gmail.com" smtp.port = 25 smtp.user = "n****@gmail.com" smtp.password...

c#,system.reactive,reactive-programming
I'm working on something that uses Reactive Extensions for .NET (Rx) and I want to have a sequence that takes its input from a queue (or similar). I've tried doing this: static readonly Queue<DeviceTransaction> TransactionQueue = new Queue<DeviceTransaction>(); //... var observableTransactionSource = TransactionQueue.ToObservable(); //... observableTransactionSource.Subscribe(transactionObserver); It works up to a...

ios,objective-c,reactive-programming,reactive-cocoa
I would like to subscribe to a signal of one web operation and have it conditionally initiate a secondary web operation. The code I have put together looks a little like this: RACSignal *asyncWebAPI = [self asyncWebAPI]; @weakify(self) [asyncWebAPI subscribeNext:^(RACTuple *tuple) { @strongify(self) NSArray *foo = tuple.first; [self.bar addObjects:foo]; self.baz...

reactive-programming,rx-java
Playing with RxJava now and stumbled upon the following problem: I have 2 different streams: Stream with items Stream (with just 1 item) which emits transformation information for the first stream. So essentially I have stream of items and I want all those items to be combined with that single...

android,retrofit,reactive-programming,rx-java,observable
My android application has a FeedDetailFragment that displays Feed details. A feed has basic information and metadata, which are retrieved through two separate calls to the server. The server interface is filled in with Retrofit. I have implemented something that, to my novice Rx knowledge, looks logical. However, as you...

retrofit,reactive-programming,rx-java,observable
How do I transform observable's error to another observable? I am trying to implement algorithm showed on scheme below: I am using a tutorial named Grokking RxJava to start my learning and found that flatMap operator can convert one Observable returning by Retrofit into another which allows me to do...

task-parallel-library,system.reactive,reactive-programming,observable
So the case is this. Suppose somewhere I am filling a Collection. Each time an element is added, an IObservable calls OnNext for its subscribers. Now, there will be a point where the collection will be filled. (I was reading something and I finished reading .. whatever). At that point,...

meteor,reactive-programming
Any browser. All other functions operate as normal. I can traverse routes, open modals, dropdowns, manipulate collections... everything works. But at some point, the browser will no longer scroll. In any view. Unless I refresh the browser window. Then scrolling goes back to normal. What might cause this? Why does...

c#,system.reactive,reactive-programming
I would like to write an Rx query that takes an IObvservable<char> and produces an IObservable<string>. The strings should be buffered until there have been no characters produced for a specified time. The data source is a serial port from which I have captured the DataReceived event and from that...

c#,xaml,listview,system.reactive,reactive-programming
This may be a remedial question, but my research is spinning me in circles right now (especially as a Java developer) and looking at several different Rx wrapper libraries. All I want is to take a ListView<MusicNote>.SelectedItem and wrap it into an IObservable, emitting a stream of the current single...

ios,reactive-programming,reactive-cocoa,racsignal
Using ReactiveCocoa, how can I chain a signal from a repeating one? I would like to do something like this: Every 5 seconds, I run a network request. For this purpose, I created a repeating signal RACSignal *each5SecondSignal = [[[RACSignal interval:5 onScheduler:[RACScheduler mainThreadScheduler]] take:1] concat:[RACSignal 5 onScheduler:[RACScheduler mainThreadScheduler]]]; and a...

objective-c,reactive-programming,reactive-cocoa
I am trying to understand this piece of code and why it returns a signal of signals. [[[self.signInButton rac_signalForControlEvents:UIControlEventTouchUpInside] map:^id(id x) { return [self signInSignal]; }] subscribeNext:^(id x) { NSLog(@"Sign in result: %@", x); }]; From what I understand the UIControlEventTouchupInside returns a next signal which contains the UIButton when...

c#,wpf,system.reactive,reactive-programming
I am creating and Search Text and want my application to perform search every 2 seconds or when there are at least 3 characters in the textbox. I am trying to use Reactive Extension's buffer or throttle to achieve the same. But I might not be clear about how these...

java,reactive-programming,rx-java
Random rand = new Random(); Observable<Integer> random1 = Observable.just(rand.nextInt()); Observable<Integer> random2 = random1.flatMap(r1->Observable.just(r1 * rand.nextInt())); random2.subscribe(System.out::println); The above code is just taking a couple of random numbers, multiplying them together, and printing the output. Here's my question: At the time that I print out the result, is there an elegant...

meteor,reactive-programming,meteor-autoform,meteor-helper
I am trying to make a custom form wizard that will contain different autoform steps based on certain conditions. A simplified meteorPad example is linked below. When the reactive data source(session variable) changes the reactive computation(template helper) runs, confirmed by console output. The template, however, is not updated and still...

java,reactive-programming,rx-java
I'm doing some more RxJava experiments, mostly trying to figure out design patterns that would work for my business. I created a simple flight tracking application that tracks multiple flights, and reacts accordingly when a flight moves. Suppose I have a Collection<Flight> with Flight objects. Each flight has an Observable<Point>...

java,asynchronous,reactive-programming,rx-java,observable
I need to observe a list of objects and emit an event as soon as there is a new object in the list. Like a client - server application where the client adds content to the list and the server emits the newly added content to all the clients registered...

java,reactive-programming,rx-java
In my last project, I use rxJava and I realize that observable.doOnError('onErrorCallback').subscribe(action) and observable.subscribe(action, 'onErrorCallback') behave in different ways. Even from docs it's not obvious for me what's exactly the difference between them and when I should use first and second variant.

haskell,functional-programming,monads,reactive-programming
I've been reading up on Functional Reactive Programming, and though I have not used monads extensively in any language, I can't help but see them everywhere in the FRP design. This question's answers have some fantastic descriptions of what functional reactive programming is, and I won't attempt to replicate that...

java,asynchronous,jersey-2.0,reactive-programming,rx-java
We are in the process of prototyping a REST API using reactive programming. As shown in the diagram, we keep 3 layers same as we used in our previouse sync API designs ; http://oi59.tinypic.com/339hhki.jpg API Layer implemented using Jersey2 which will process request/deserialize JSON and handover to Service Layer. Service...

javascript,system.reactive,reactive-programming,rxjs,reactive-extensions-js
Live example. I'm completely new to Rx*. I'm trying to create a reactive version of MVC using RxJS for my thesis. It's loosely based on https://github.com/staltz/mvi-example I probably should've studied RxJS more before starting to code, but I've realised I usually learn the best by just jumping to the deep...

c#,.net,system.reactive,reactive-programming
I have an observable stream that produces values at inconsistent intervals like this: ------1---2------3----------------4--------------5--- And I would like to sample this but without any empty samples once the a value has been produced: ------1---2------3----------------4--------------5----- ----_----1----2----3----3----3----4----4----4----5----5 I obviously thought Replay().RefCount() could be used here to provide the last known value to...

java,multithreading,recursion,reactive-programming,rx-java
I had some working recursion code in my RxJava-based network stack for flatMapping the HTTP body string file listing into an Observable of custom POJOs representing the files. However, I was using .scheduleOn(Schedulers.newThread()), which uses multiple new threads to do the work. I just found out one of the devices...

java,multithreading,reactive-programming,rx-java
I want to use the reduce() operation on observable to map it to a Guava ImmutableList, since I prefer it so much more to the standard ArrayList. Observable<String> strings = ... Observable<ImmutableList<String>> captured = strings.reduce(ImmutableList.<String>builder(), (b,s) -> b.add(s)) .map(ImmutableList.Builder::build); captured.forEach(i -> System.out.println(i)); Simple enough. But suppose I somewhere scheduled the...

javascript,reactive-programming,rxjs,reactive-extensions-js
I've got a special producer consumer problem in RxJS: The producer slowly produces elements. A consumer is requesting elements and often has to wait for the producer. This can be achieved by zipping the producer and the request stream: var produce = getProduceStream(); var request = getRequestStream(); var consume =...