Interface CloudEventsFunction

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 CloudEventsFunction
Represents a Cloud Function that is activated by an event and parsed into a CloudEvent object.
  • Method Summary

    Modifier and Type Method Description
    void accept​(io.cloudevents.CloudEvent event)
    Called to service an incoming event.
  • Method Details

    • 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.