question

Yue Y avatar image
0 Likes"
Yue Y asked Yue Y commented

How do make basicFR accept specified number of items at a time.

I would like the basicFR to behave in such a way that: it can accept specified number of items at a time. This number is received from an external service using http request. How can I code basicFR so that it can open its input port, accept that number of flow items, close the input port?

basicfr
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Emily Hardy avatar image Emily Hardy ♦ commented ·

Yue- I can work on a solution for you using the BasicFR, but would you be open to using the combiner? It seems like it would fit what you're looking for.

0 Likes 0 ·

1 Answer

Yue Y avatar image
0 Likes"
Yue Y answered Yue Y commented

I am considering using a global variable to store the count, once the item enters basicfr, it will decrement the count, if the count is still larger than 0, it would open the port again to accept next item. Do you think the combiner is easier to implement compared with this solution?

· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Emily Hardy avatar image Emily Hardy ♦ commented ·

I would use a queue rather than a basicFR or a combiner in that case; it's probably the easiest one to do this with, and it automatically takes items from the preceding FR unlike a basicFR. Are yoiu familiar with using process flow? Can I use that in my example for you?

0 Likes 0 ·
Yue Y avatar image Yue Y Emily Hardy ♦ commented ·

In my use case, I can't use a queue, everything must happen inside the basicFR. The solution I mentioned worked fine, I will go with that one for now. Thank you for your help!

0 Likes 0 ·
Emily Hardy avatar image Emily Hardy ♦ Yue Y commented ·

Great!

0 Likes 0 ·
Yue Y avatar image Yue Y commented ·

If you have multiple input ports, any item entering the port will close all input ports and You must reopen them if necessary

0 Likes 0 ·