Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive examples and integration test #4

Open
melloware opened this issue Oct 24, 2023 · 2 comments
Open

Reactive examples and integration test #4

melloware opened this issue Oct 24, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@melloware
Copy link
Contributor

melloware commented Oct 24, 2023

I am not as familiar with Reactive but an example in the docs and an Integration test would be great for someone to add as a good first issue.

https://quarkus.io/guides/resteasy-reactive#multipart

@melloware melloware added the good first issue Good for newcomers label Oct 24, 2023
@melloware melloware added the documentation Improvements or additions to documentation label Nov 22, 2023
@ggrebert
Copy link
Contributor

ggrebert commented Jan 19, 2024

The problem with the reactive part is that the AntivirusEngine signature is not ready to implement the feature.

There is not an easy way to implement it without a breaking change.

Reactive signature example with Mutiny:

package io.quarkiverse.antivirus.runtime;

import java.io.InputStream;
import io.smallrye.mutiny.Uni;

/**
 * Service provider interface for virus scanning that might be used in file upload component for example when dealing with
 * untrusted files.
 */
public interface AntivirusEngine {

    /**
     * Indicate whether this {@link AntivirusEngineReactive} is enabled or not.
     *
     * @return <code>true</code> if enabled, <code>false</code> otherwise
     */
    boolean isEnabled();

    /**
     * Perform virus scan and throw exception if a virus has been detected.
     *
     * @param filename the name of the file to scan
     * @param inputStream the inputStream containing the file contents
     * @return the {@link AntivirusScanResult} containing the results
     */
    Uni<AntivirusScanResult> scan(final String filename, final InputStream inputStream);
}

To implement a reactive engine, the easy way is maybe to use Vertx with Mutiny.
But we can also use Vertx or native JAVA API with CompletionStage.

@melloware
Copy link
Contributor Author

@ggrebert PR is welcome. This is still a BETA library only at 0.0.4 so I am not worried about breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants