Skip to content

Conversation

@M-Kusumgar
Copy link
Contributor

@M-Kusumgar M-Kusumgar commented Dec 9, 2025

Closes #756

I also think I need to create a GetOutputExtensionLayer for the GetOutputExtension. Is this what you had in mind? I basically added a copy of serve but instead it passes the cloned value of the extension from the output to the callback passed in.

Copy link
Member

@GlenDC GlenDC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough. You seem to have gotten it well :)
Thank you!

@GlenDC
Copy link
Member

GlenDC commented Dec 9, 2025

@M-Kusumgar if the CI passes I'll merge it in.

Feel free if you have the motivation to open a 2nd PR to do the same for AddExtension service (rename it to AddInputExtension) and also copy it to also have an AddOutputExtension variant).

@GlenDC
Copy link
Member

GlenDC commented Dec 9, 2025

@M-Kusumgar seems the basic checks fail.
Please run

just qq

in your local environment, fix if something has to be fixed and commit the changes made by you and/or tooling.

@M-Kusumgar
Copy link
Contributor Author

was just some formatting just qq has passed on my local system! will make sure to run that before raising a pr thanks

@GlenDC GlenDC merged commit 6876043 into plabayo:main Dec 9, 2025
34 checks passed
GlenDC pushed a commit that referenced this pull request Dec 9, 2025
…xtension (#761)

Couple of thoughts I had while doing this one:
* I am not sure if my example at the top of `add_extension` with the
`ResponseCounter` is a good one, happy to change it/remove it if we
don't need an example
* The `serve` function for `AddInputExtension` used to return a
`Future<>` but for `AddOutputExtension` I needed to await to get the
response, so I made both of them consistent and converted them into
`async fn`s. This is also consistent with `GetInputExtension` and
`GetOutputExtension`. I am not super familiar with async rust (let alone
rust) so I am not 100% sure about the implications of this change but I
have done a bit of looking into it so `async fn` is the same as
returning a `Future<>` from a function that wraps the original function
body in an `async move`. The things im not sure about are:
* `'_` - im not sure we need this, presumably we want the returned value
to live as long as the args, is that the default for async functions?
* `Send` - not sure if we need to enforce it on the return here, `Input`
has the trait enforced and its the only one we take a mutable reference
to

Relates to #759
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide GetExtension for Output extensions

2 participants