package com.atlassian.bitbucket.mesh.grpc;

import javax.annotation.Nonnull;

/**
 * Defines a mechanism for parsing request messages.
 *
 * @param <ReqT> the message request type
 * @param <RespT> the message response type
 */
public interface RequestMessageHandler<ReqT, RespT> {

    /**
     * This method will be called for every message.
     *
     * @param message the message
     * @return the response
     */
    @Nonnull
    RespT onMessage(@Nonnull ReqT message);
}
