from edu.sc.seis.fissuresUtil.flow import Receiver, Message
from edu.sc.seis.fissuresUtil.flow.querier import EventFinderIterator, EventFinderQuery
from gee.SenderBase import SenderBase

class EventServer(SenderBase):
    def __init__(self, finder, receiver=None):
        SenderBase.__init__(self, receiver=receiver)
        self.finder = finder
        
    def run(self):
        for event in EventFinderIterator.create(self.finder, EventFinderQuery()):
            self.send(Message(event))
            
