In Jina, when is `uses_after` in `Pod` applied?

Viewed 72

Is the uses_after keyword in a pod tells me, what should happen as an aggregation method on all the results of shards defined in uses, that ran in parallel? So it should have access to all the results, that were given by the pods defined under uses?

So the tail_pea should get all the results of the parallel peas as for example in the ReduceAllDriver in the hello-world example, right?

1 Answers

First, let me clarify three uses here. uses is defined at Pea level; uses-after and uses-before are defined at Pod level.

So when you define uses-after, uses-before and uses at Pod level, the assignment would be:

  • head_pea gets uses_before,
  • tail_pea gets uses_after
  • all replicas (aka parallel peas) get uses

In the current ReduceDriver implementation, __call__ is called 4 times but reduce is called only one time.

Related