# Will generator's limitation be remove?dynamic number of return for actor and schedule dependent tasks

**URL:** <https://discuss.ray.io/t/will-generators-limitation-be-remove-dynamic-number-of-return-for-actor-and-schedule-dependent-tasks/9451>\
**Category:** Ray Core\
**Created:** [February 22, 2023, 7:13am UTC](https://discuss.ray.io/t/will-generators-limitation-be-remove-dynamic-number-of-return-for-actor-and-schedule-dependent-tasks/9451 "2023-02-22T07:13:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarjintor](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tarjintor/32/3552_2.png) [@tarjintor](https://discuss.ray.io/u/tarjintor)\
**Post date:** [February 22, 2023, 7:13am UTC](https://discuss.ray.io/t/will-generators-limitation-be-remove-dynamic-number-of-return-for-actor-and-schedule-dependent-tasks/9451/1 "2023-02-22T07:13:05Z")

</div>

Hello,I need use generoator which is an actor task,and the method will yield dynamic number of results which is depends on inputs of the method, and I wish to get every return once it had been yield by the actor  
I read the doc [Generators — Ray 2.2.0](https://docs.ray.io/en/latest/ray-core/tasks/generators.html#limitations)  
and it says this is not support yet.  
I wish there might be some hack trick to archive this?  
And I also wonder why can’t ray support dynamic number of yields at first as in most use case, a generator won’t returns a static number of value.

---

<div class="post-metadata">

**Author:** ![yic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yic/32/437_2.png) [@yic](https://discuss.ray.io/u/yic)\
**Post date:** [February 22, 2023, 9:00pm UTC](https://discuss.ray.io/t/will-generators-limitation-be-remove-dynamic-number-of-return-for-actor-and-schedule-dependent-tasks/9451/2 "2023-02-22T21:00:34Z")

</div>

@tarjintor [Generators — Ray 2.3.0](https://docs.ray.io/en/releases-2.3.0/ray-core/tasks/generators.html)

I think it’ll be supported in 2.3. Could you give it a try?

---

<div class="post-metadata">

**Author:** ![tarjintor](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/tarjintor/32/3552_2.png) [@tarjintor](https://discuss.ray.io/u/tarjintor)\
**Post date:** [February 23, 2023, 12:50am UTC](https://discuss.ray.io/t/will-generators-limitation-be-remove-dynamic-number-of-return-for-actor-and-schedule-dependent-tasks/9451/3 "2023-02-23T00:50:32Z")

</div>

this is great,thx,I will try it
