NYBus | sub library for Android and Java applications | Reactive Programming library
kandi X-RAY | NYBus Summary
kandi X-RAY | NYBus Summary
NYBus (RxBus) - A pub-sub library for Android and Java applications
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a large number of events .
- Initialize all the publishers .
- Determines the thread and event publisher .
- Gets and adds the subscribe hook holder to the map .
- Creates events from BgThread
- Returns all event types for the given event class .
- Converts variable names to a list of channel IDs .
- Get singleBus instance .
- Checks if is unit test
- Gets the key for the subscription holder map .
NYBus Key Features
NYBus Examples and Code Snippets
Community Discussions
Trending Discussions on NYBus
QUESTION
I'm writing a listener for messages using the Rx framework.
The problem I'm facing is that the library I'm using uses a consumer that publishes events whenever a message has arrived.
I've managed to consume the incoming messages via Observable.FromEventPattern
but I have a problem with the messages that are already in the server.
At the moment I have the following chain of commands
- Create a consumer
- Create an observable sequence with
FromEventPattern
and apply needed transformations - Tell the consumer to start
- Subscribe to the sequence
The easiest solution would be to swap steps 3. and 4. but since they happen in different components of the system, it's very hard for me to do so.
Ideally I would like to execute step 3 when step 4 happens (like a OnSubscribe
method).
Thanks for your help :)
PS: to add more details, the events are coming from a RabbitMQ queue and I am using the EventingBasicConsumer
class found in the RabbitMQ.Client package.
Here you can find the library I am working on. Specifically, this is the class/method giving me problems.
Edit
Here is a stripped version of the problematic code
...ANSWER
Answered 2018-Apr-03 at 08:04I think there is no need to actually subscribe to rabbit queue (via BasicConsume
) until you have subscribers to your observable. Right now you are starting rabbit subscription right away and push items to observable even if no one has subscribed to it.
Suppose we have this sample class:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NYBus
You can use NYBus like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the NYBus component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page