flow/actor: add single_sink/single_source retrieval methods
This commit is contained in:
parent
f7cac15b34
commit
9228e8a96d
|
@ -60,6 +60,16 @@ class Actor:
|
|||
|
||||
def sources(self):
|
||||
return self.filter_endpoints(Source)
|
||||
|
||||
def single_sink(self):
|
||||
eps = self.sinks()
|
||||
assert(len(eps) == 1)
|
||||
return eps[0]
|
||||
|
||||
def single_source(self):
|
||||
eps = self.sources()
|
||||
assert(len(eps) == 1)
|
||||
return eps[0]
|
||||
|
||||
def get_control_fragment(self):
|
||||
raise NotImplementedError("Actor classes must overload get_control_fragment or get_fragment")
|
||||
|
|
Loading…
Reference in New Issue