Package org.red5.server.messaging
Class InMemoryPushPushPipe
java.lang.Object
org.red5.server.messaging.AbstractPipe
org.red5.server.messaging.InMemoryPushPushPipe
- All Implemented Interfaces:
IMessageInput
,IMessageOutput
,IPipe
A simple in-memory version of push-push pipe. It is triggered by an active provider to push messages through it to an event-driven consumer.
- Author:
- Steven Gong (steven.gong@gmail.com), Paul Gregoire (mondain@gmail.com)
-
Field Summary
Fields inherited from class org.red5.server.messaging.AbstractPipe
consumers, listeners, providers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionPull message from this input endpoint.pullMessage
(long wait) Pull message from this input endpoint.void
pushMessage
(IMessage message) Pushes a message out to all the PushableConsumers.boolean
Connect consumer to this pipe.boolean
Connect provider to this pipe.Methods inherited from class org.red5.server.messaging.AbstractPipe
addPipeConnectionListener, close, fireConsumerConnectionEvent, firePipeConnectionEvent, fireProviderConnectionEvent, getConsumers, getListeners, getProviders, removePipeConnectionListener, sendOOBControlMessage, sendOOBControlMessage, setListeners, unsubscribe, unsubscribe
-
Field Details
-
log
private static final org.slf4j.Logger log
-
-
Constructor Details
-
InMemoryPushPushPipe
public InMemoryPushPushPipe() -
InMemoryPushPushPipe
-
-
Method Details
-
subscribe
Connect consumer to this pipe. Doesn't allow to connect one consumer twice. Does register event listeners if instance of IPipeConnectionListener is given.- Specified by:
subscribe
in interfaceIMessageInput
- Overrides:
subscribe
in classAbstractPipe
- Parameters:
consumer
- ConsumerparamMap
- Parameters passed with connection, used in concrete pipe implementations- Returns:
- true if consumer was added, false otherwise
-
subscribe
Connect provider to this pipe. Doesn't allow to connect one provider twice. Does register event listeners if instance of IPipeConnectionListener is given.- Specified by:
subscribe
in interfaceIMessageOutput
- Overrides:
subscribe
in classAbstractPipe
- Parameters:
provider
- ProviderparamMap
- Parameters passed with connection, used in concrete pipe implementations- Returns:
- true if provider was added, false otherwise
-
pullMessage
Pull message from this input endpoint. Return w/o waiting.- Returns:
- The pulled message or null if message is not available.
-
pullMessage
Pull message from this input endpoint. Wait wait milliseconds if message is not available.- Parameters:
wait
- milliseconds to wait when message is not available.- Returns:
- The pulled message or null if message is not available.
-
pushMessage
Pushes a message out to all the PushableConsumers.- Parameters:
message
- the message to be pushed to consumers- Throws:
IOException
- In case IOException of some sort is occurred
-