mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 02:58:32 +08:00
MergedParallelBuffer -> Merge, ParallelBuffer -> Feed
This commit is contained in:
@@ -42,9 +42,9 @@ class Component(object):
|
||||
|
||||
:param data_address: socket address used for data sources to stream
|
||||
their records. Will be used in PUSH/PULL sockets
|
||||
between data sources and a ParallelBuffer (aka
|
||||
the Feed). Bind will always be on the PULL side
|
||||
(we always have N producers and 1 consumer)
|
||||
between data sources and a Feed. Bind will always
|
||||
be on the PULL side (we always have N producers and
|
||||
1 consumer)
|
||||
|
||||
:param feed_address: socket address used to publish consolidated feed
|
||||
from serialization of data sources
|
||||
@@ -53,9 +53,9 @@ class Component(object):
|
||||
|
||||
:param merge_address: socket address used to publish transformed
|
||||
values. will be used in PUSH/PULL from many
|
||||
transforms to one MergedParallelBuffer (aka the
|
||||
Merge). Bind will always be on the PULL side (we
|
||||
always have N producers and 1 consumer)
|
||||
transforms to one Merge Bind will always be on
|
||||
the PULL side (we always have N producers and
|
||||
1 consumer)
|
||||
|
||||
:param result_address: socket address used to publish merged data
|
||||
source feed and transforms to clients will be
|
||||
|
||||
@@ -39,8 +39,8 @@ class ComponentHost(Component):
|
||||
self.sync_register = {}
|
||||
self.timeout = datetime.timedelta(seconds=5)
|
||||
|
||||
self.feed = ParallelBuffer()
|
||||
self.merge = MergedParallelBuffer()
|
||||
self.feed = Feed()
|
||||
self.merge = Merge()
|
||||
self.passthrough = PassthroughTransform()
|
||||
self.controller = None
|
||||
|
||||
@@ -173,7 +173,7 @@ class ComponentHost(Component):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class ParallelBuffer(Component):
|
||||
class Feed(Component):
|
||||
"""
|
||||
Connects to N PULL sockets, publishing all messages received to a PUB
|
||||
socket. Published messages are guaranteed to be in chronological order
|
||||
@@ -367,13 +367,13 @@ class ParallelBuffer(Component):
|
||||
return len(self.data_buffer)
|
||||
|
||||
|
||||
class MergedParallelBuffer(ParallelBuffer):
|
||||
class Merge(Feed):
|
||||
"""
|
||||
Merges multiple streams of events into single messages.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
ParallelBuffer.__init__(self)
|
||||
Feed.__init__(self)
|
||||
|
||||
self.init()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user