greenrobot / EventBus

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
http://greenrobot.org/eventbus/
Apache License 2.0
24.67k stars 4.66k forks source link

org.greenrobot.eventbus.EventBus#post doesn't support generic type. #717

Closed Halcyon666 closed 1 year ago

Halcyon666 commented 1 year ago

Q1 [org.greenrobot.eventbus.EventBus#post doesn't support generic type.]

  1. I integer the EventBus with SpringBoot, using @Configuration Inject MyselfEventBus which extends the greenrobot EventBus, and register the subscriber with generic param type .
  2. I post the event using the unanimous generic param type.
  3. THEN I CALL THE POST METHOD,THERE HINTS No subscribers registered for event XXX
  4. WHEN I remove both the generic param type in subscriber and post method, the eventBus works.

    I don't know whether it is problem, maybe My usage situation is odds.

Q2 [through reflect invoke the method, and not return the result, how I design my program,maybe query the result later, could there have some callback or future]

Halcyon666 commented 1 year ago

Wish the replies, thanks guys

greenrobot-team commented 1 year ago

If I understand this correctly, see #23 about this.

Halcyon666 commented 1 year ago

If I understand this correctly, see #23 about this.

yeah, u are right. Thanks ,I’ll close the issue. One day maybe support this.