reactive-programming

How do Meteor.subscribe and MyCollection.find* operations interact?

爷,独闯天下 提交于 2019-12-12 04:40:08
问题 I've been following lots of meteor examples and working through discover meteor, and now I'm left with lots of questions. I understand subscribe and fetch are ways to get "reactivity" to work properly, but I still feel unsure about the relationship between find operations and subscriptions/fetch. I'll try to ask some questions in order to probe for some holistic/conceptual answers. Question Set 1: In the following example we are fetching 1 object and we are subscribing to changes on it:

How should one go about implementing a DistinctLatest (and caching) operator in Rx?

两盒软妹~` 提交于 2019-12-12 03:41:46
问题 I had a question A cache serving updates and new values as “DistinctLatest” and full cache contents upon subscription, which was well handled by the community. A question was raised that the actual goal of caching and replacing values like defined in the aforementioned question could be defined with a .DistinctLatest operator. OK! There doesn't seem to be much talk about such an operator. While searching, and thinking about it, I found ReactiveX: Group and Buffer only last item in each group,

Rxjs - Subscribing to interdependent observables

微笑、不失礼 提交于 2019-12-12 02:22:06
问题 I am learning angular 2 and rxjs. I have 3 variables, A B C. B depends on the value of A C depends on the value of A and B I am trying to setup up the observables such that: When A is updated, B and C will be auto updated. When B is updated, C will be auto updated. I tried two setups but they are not satisfactory. First setup: B subscribes observable A; C subscribes observable B withlatestfrom A. The changes in A did cascade down to B then to C but the value from A is not the latest. Second

Lagom message durability between persistent actor and read processor

穿精又带淫゛_ 提交于 2019-12-12 02:16:11
问题 just wondering about the guarantee of the event notification delivery from the persistent event sourced actor to the read processor in lagom , is there any or there is no message durability for event notification to the read processor which will update the query side ? I understand there is eventual consistency which is fine but i am talking about the event handler notification to the Cassandra read processor. 回答1: Event processing is guaranteed by using event sourcing in the persistent

Play Framework 2.5 Streaming content with delay

旧街凉风 提交于 2019-12-12 01:57:08
问题 I have been trying to stream content through HTTP with Play Framework 2.5 in Java with a delay. The problem is that I am not sure if the result is actually streaming, that is why I tried to delay each item from emitting which does not seem to work for some reason. The code public Result test(){ HttpEntity http = new HttpEntity.Streamed(Source.range(0, 99999) .map(i -> ByteString.fromString(i.toString())) .initialDelay(FiniteDuration.create(200, TimeUnit.MILLISECONDS)) , Optional.empty(),

Reactive Extensions: Why does this exit immediately?

烂漫一生 提交于 2019-12-11 21:26:24
问题 I am reading IntroToRx and I'm having a bit of trouble with the sample code. Here is the sum total of my code: using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Disposables; using System.Reactive.Linq; using System.Reactive.Subjects; using System.Text; using System.Threading; using System.Threading.Tasks; namespace LearningReactiveExtensions { public class Program { static void Main(string[] args) { var observable = Observable.Interval(TimeSpan

WebFlux not sending data when using application/stream+json

非 Y 不嫁゛ 提交于 2019-12-11 21:22:30
问题 I have a reactive core WebClient to post to a given endpoint. The payload is a flux of Job objects and the content-type is application/stream+json Flux jobFlux = Flux.just(new Job()); Mono<JsonNode> response = localEP.post().uri( "/dev/job" ) .contentType(MediaType.APPLICATION_STREAM_JSON) .body( BodyInserters.fromObject(jobFlux)) .retrieve() .bodyToMono( JsonNode.class ); On the server end I have tried both a Spring Controller style and Spring Web Reactive FunctionHandler to process the

When FlatMap will listen to multiple sources concurrently?

限于喜欢 提交于 2019-12-11 16:42:48
问题 What are the situations which cause Flux::flatMap to listen to multiple sources (0...infinity) concurrently? I found out, while experimenting, that when the upstream send signals to flatMap in thread thread-upstream-1 and there are N inner streams which flatMap will listen to and each of them send signals in different thread: thread-inner-stream-i for 1<=i<=N , than for every 1<=i<=N if thread-upstream-1 != thread-inner-stream-i , flatMap will listen concurrently to all the inner streams. I

angular reactive form valuechanges with pipe. IS THIS A BUG ???

﹥>﹥吖頭↗ 提交于 2019-12-11 15:15:04
问题 Seems like pipe doesn't work with reactive form control valueChanges. i've prepared this https://stackblitz.com/edit/angular-vdeqrz so that you can reproduce the problem. type something in the text field. then type "boom" (without the quotes). after the error catch, the control does not work any more. you can verify typing something new on it after that. it does not detect any other input. if you refresh the page, then it works again. am i missing something here ? 回答1: This is not a bug.

Spring Boot 2 & Spring 5 Container confusion

吃可爱长大的小学妹 提交于 2019-12-11 15:00:23
问题 I have a Spring boot 1.4.3 project. Recently I have come up with a requirement where I have to send logs from server to my web application and print the logs on the web page. I am aware of WebSockets but I was looking for better solutions and I came across, Reactive Programming and gRPC. Spring is supporting Reactive Programming in Spring version 5, but I am quite confused between gRPC and Reactive Programming. gRPC features Bi-Directional streaming which is built on top of Netty and provides