Interface ExperimentalCloudEventsFunction

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ExperimentalCloudEventsFunction
    Represents a Cloud Function that is activated by an event and parsed into a CloudEvent object. Because the CloudEvent API is not yet stable, a function implemented using this class may not build or work correctly with later versions of that API. Once the API is stable, this interface will become CloudEventsFunction and will also be stable.
    • Method Detail

      • accept

        void accept​(io.cloudevents.CloudEvent event)
             throws java.lang.Exception
        Called to service an incoming event. This interface is implemented by user code to provide the action for a given background function. If this method throws any exception (including any Error) then the HTTP response will have a 500 status code.
        Parameters:
        event - the event.
        Throws:
        java.lang.Exception - to produce a 500 status code in the HTTP response.