import com.rameses.annotations.*;
import com.rameses.common.*;
import com.rameses.util.*;

class WsQueueChannelListener {    

	@XConnection("queue_poll")
	def queue_poll; 

	@Service 
	def self; 

	@OnMessage('ws_queue_listener') 
	void receive( data ) { 
		println '[WsQueueChannelListener] ' + data; 
		self.notify( data );
	} 

	@Async 
	@ProxyMethod(local=true) 
	void notify( data ) { 
		if ( data ) { 
			queue_poll.send( data );  
		} 
	}
} 
