Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dorus
    @Dorus
    I'm not sure why RxJava is not connected to the rest.
    Alessandro Vermeulen
    @spockz
    different repos?
    in different orgs
    ReactiveJS is pretty busy with almost 1k participant
    Dorus
    @Dorus
    ReactiveJS has nothing to do with Rx right?
    Alessandro Vermeulen
    @spockz
    @Dorus sorry meant RxJS :)
    Dorus
    @Dorus
    yeah, very active.
    Alessandro Vermeulen
    @spockz
    I could imagine that React and Angular would use RxJS for their streaming purposes instead of their own stuff..
    David Stemmer
    @weefbellington
    @Dorus are you an Rx contributor?
    Dorus
    @Dorus
    ?
    David Stemmer
    @weefbellington
    I mean do you contribute to one of the frameworks itself
    Dorus
    @Dorus
    code? Not really, i did fill some bugs
    David Stemmer
    @weefbellington
    I was just curious, I know Artem Zinnatullin works on RxJava, just thought you might be a contributor since you're the most active in this channel
    Dorus
    @Dorus
    I haven't seen many contributors yes in these channels, they usually do respond quickly to github issues.
    David Stemmer
    @weefbellington
    unfortunately, it seems like the number of rxjava contributors has dwindled over time
    Dorus
    @Dorus
    @weefbellington I've seen your name around a few times before, what's your tie to Rx?
    David Stemmer
    @weefbellington
    no tie just a user
    but I think that Ben Christensen is pouring his efforts into Reactive Extensions right now
    Reactive Streams I mean
    I believe that David Karnok is the core contributor now but he spends a lot of his time on nowadays on Project Reactor rather than RxJava
    Dorus
    @Dorus
    ic. I did notice Rx development is kinda slow. Good thing the current library is pretty solid.
    RxJS does seem to have a lot of progress on v5.
    And Rx.Net is completely silent.
    David Stemmer
    @weefbellington
    do you know if v5 using the Reactive Streams specification?
    Dorus
    @Dorus
    All i know is that the migration document mentiones "Compliance with the ES7 Observable Spec"
    (And also that i like onNext a lot more than next)
    Alessandro Vermeulen
    @spockz
    @Dorus do you know about any comprehensive documentation regarding back pressure? Akka streams have it automatically, how about rxjava?
    Dorus
    @Dorus
    Alessandro Vermeulen
    @spockz
    @Dorus not thoroughly
    @Dorus Ill go and read that
    Alessandro Vermeulen
    @spockz
    @Dorus do I understand doOnNext correctly if I say it doesn't create any subscribers? When I create a Subject and use doOnNext on it the callback isn't called on the onNext, when I use subscribe with an Action1 I see a new subscriber being created and the actual method is called
    Dorus
    @Dorus
    Nothing happens until you subscribe.
    But once you do, both doOnNext and whatever happens in the subscription is called.
    Alessandro Vermeulen
    @spockz
    @Dorus yes thats what I noticed as well
    so it is by design. Okay. :)
    Dorus
    @Dorus
    This is the very basic of Rx, you write an reactive program, you specify 'if this happen, do that'. So with source.doOnNext(action), you say 'If the source emit, do action'. Once you call subscribe, you say 'source please start emitting'
    Alessandro Vermeulen
    @spockz
    @Dorus yes but somehow I expected doOnError to be a shorthand for subscribing
    Dorus
    @Dorus
    no, it's a hook into the pipeline to add side effects to the sequence.
    Alessandro Vermeulen
    @spockz
    @Dorus now I remember indeed
    Josh Durbin
    @joshdurbin
    Heya folks
    I’m struggling with how to architect an rx flow for user account creation..
    Essentially what I want to do is:
    1. check a rx data store to see if a record exists for a username
    2. if record exists, error, else continue
    3. insert user object in rx data store using encryption tools (blocking)
    4. create jwt token using data from (3)
    Does it make sense to have that as one starting stream (from the query in step 1) to the end?
    amitahirrao
    @amitahirrao
    Hi, I was in the process of selecting a Reactive framework for my project and was comparing it to Spring Reactor . Thoughts? suggestions?
    Josh Durbin
    @joshdurbin
    This message was deleted
    Josh Durbin
    @joshdurbin
    … something like this:
      Observable<String> createAccount(final String username, final String password, final String emailAddress) {
    
        mongoDatabase.getCollection(UserCodec.COLLETION_NAME, User)
          .find(eq(UserCodec.USERNAME_PROPERTY, username))
          .toObservable()
          .isEmpty()
          .map { final Boolean userStreamIsEmpty ->
    
          if (!userStreamIsEmpty) {
    
            throw new Exception("A user with the same username '${username}' was found in the DB")
          }
    
          userStreamIsEmpty
        }.flatMap({ final Boolean userStreamIsEmpty ->
    
          // MONGO DB REFERENCE IS RX MONGO, PASSWORD GENERATION IS BLOCKING. NOT SURE WHAT HAPPENS IN TERMS OF THREADING HERE...
          mongoDatabase.getCollection(UserCodec.COLLETION_NAME, User)
            .insertOne(new User(username: username, password: PasswordFactory.create().hash(password), emailAddress: emailAddress))
            .asObservable()
        } as Func1).map { final Success success ->
    
          mongoDatabase.getCollection(UserCodec.COLLETION_NAME, User)
            .find(eq(UserCodec.USERNAME_PROPERTY, username))
        }.flatMap({ final User retrievedUser ->
    
          Jwts
            .builder()
            .setPayload(Jackson.json(retrievedUser) as String)
            .setIssuedAt(new Date())
            .setExpiration(Date.from(LocalDateTime.now().plusHours(48).toInstant(ZoneOffset.UTC)))
        } as Func1)
        .bindExec()
      }
    Starts as a stream of type User -> Boolean (isEmpty) -> Boolean (just cause?) -> Success -> User -> String
    Josh Durbin
    @joshdurbin
    Alright, this works, but can it be better…?
      Observable<String> createAccount(final String username, final String password, final String emailAddress) {
    
        mongoDatabase.getCollection(UserCodec.COLLETION_NAME, User)
          .find(eq(UserCodec.USERNAME_PROPERTY, username))
          .toObservable()
          .isEmpty()
          .map { final Boolean userStreamIsEmpty ->
    
          if (!userStreamIsEmpty) {
    
            throw new Exception("A user with the same username '${username}' was found in the DB")
          }
    
          userStreamIsEmpty
        }.flatMap({ final Boolean userStreamIsEmpty ->
    
          mongoDatabase.getCollection(UserCodec.COLLETION_NAME, User)
            .insertOne(new User(username: username, password: PasswordFactory.create().hash(password), emailAddress: emailAddress))
        } as Func1).flatMap( { final Success success ->
    
          mongoDatabase.getCollection(UserCodec.COLLETION_NAME, User)
            .find(eq(UserCodec.USERNAME_PROPERTY, username))
            .toObservable()
        } as Func1).map({ final User retrievedUser ->
    
          Jwts
            .builder()
            .setId(retrievedUser.id.toString())
            .setIssuedAt(new Date())
            .setExpiration(Date.from(LocalDateTime.now().plusHours(48).toInstant(ZoneOffset.UTC)))
            .compact()
        } as Func1)
        .bindExec()
      }
    Alessandro Vermeulen
    @spockz
    @joshdurbin I suppose that's fine. You might want to think about what should happen on which thread.