Skip to content

Warn when RequestHandler doesn't invoke response.onSubscribe() #25

Closed

Description

@yschimke

Can we detect this after requestHandler.handle*() is called and print a warning or fail noisily and early? At least during development this should be the default.

production behaviour to be discussed.

Activity

  1. benjchristensen commented on May 16, 2016

    @benjchristensen
    Contributor

    it increases compiled code size

    I'm struggling to see why this is a concern. I buy that it may not be a check we care about, but why is "compiled code size" a big deal here? And how much increase are we talking about?

  2. yschimke commented on May 16, 2016

    @yschimke
    MemberAuthor

    My concern with the mixin approach is that it relies on a n00b user doing extra work to get warned about n00b errors.

  3. benjchristensen commented on May 16, 2016

    @benjchristensen
    Contributor

    Regarding logging, the entire RxJava library has no logging, so I'm quite alright with us avoiding what is generally just a waste of space.

    We should support hooking in for insights when we want, but I don't like code littered with logging everywhere just because.

  4. benjchristensen commented on May 16, 2016

    @benjchristensen
    Contributor

    Code size is the most important on mobile

    Agreed. If it's trivial though we shouldn't prevent correctness/safety guards.

  5. lehecka commented on May 31, 2016

    @lehecka
    Contributor

    I would suggest relaxing the original proposal to this:
    after requestHandler.handle* is called we validate that
    a) response.OnSubscribe was called
    b) response.OnComplete/OnError was called

    This will simplify writing the handler for the cases when the handler wants to terminate right away. The subscription object is unnecessary for sending the terminating signal.

  6. lehecka commented on Jan 26, 2017

    @lehecka
    Contributor

    the most relaxed solution was implemented. onSubscribe doesn't have to be called immediately.
    Closing the issue as the discussion is closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions