package com.ecep.contract.service.tasker;

import java.util.concurrent.Callable;
import java.util.function.BiConsumer;
import java.util.function.Predicate;

import com.ecep.contract.Message;
import com.ecep.contract.handler.SessionInfo;
import com.fasterxml.jackson.databind.JsonNode;

public interface WebSocketServerTasker extends Callable<Object> {
    void init(JsonNode argsNode);

    default void setSession(SessionInfo session) {
    }

    /**
     * 设置消息处理函数
     */
    void setMessageHandler(Predicate<Message> messageHandler);

    void setTitleHandler(Predicate<String> titleHandler);

    void setPropertyHandler(BiConsumer<String, Object> propertyHandler);

    void setProgressHandler(BiConsumer<Long, Long> progressHandler);

}
