Neng,
Il Gio 20 Gen 2022, 20:20 Neng Lu <[email protected]> ha scritto:
> Hi All,
>
> Just want to bring this PIP[1] to your attention. The PRs [2] have been
> open for quite some time. The feature is valuable for many use cases and I
> would like to help the original author to push the effort on it.
>
> The general idea is introducing a new API for Pulsar Functions which allows
> develop to customize some setup and close logic.
I am +1 on your proposal.
I left some feedback on the second PR. Basically we need some unit tests
and integration tests.
The first PR looks obsolete, please close it.
Enrico
The API should look like
> this:
>
> ```
> public interface RichFunction extends Function{
>
> /**
> * Called when function instance start
> *
> * @throws Exception
> */
> void setup(Context context) throws Exception;
>
> /**
> * Called when function instance close
> *
> * @throws Exception
> */
> void tearDown() throws Exception;
> }
> ```
>
> Please join the discussion if you have any questions or concerns for this
> new API.
>
> [1] PIP-86
> <
> https://github.com/apache/pulsar/wiki/PIP-86%3A-Pulsar-Functions%3A-Preload-and-release-external-resources
> >
> [2] PR-11112 <https://github.com/apache/pulsar/pull/11112> PR-13205
> <https://github.com/apache/pulsar/pull/13205>
>
> Best regards,
> Neng
>