package com.backendsys.modules.sdk.comfyui.rabbitmq;

import com.rabbitmq.client.Channel;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
public class DeliveryTagHolder {
    private final Map<String, TagCtx> map = new ConcurrentHashMap<>();

    public void put(String key, long tag, Channel ch) {
        map.put(key, new TagCtx(tag, ch));
    }

    public TagCtx take(String key) {
        return map.remove(key);
    }
}

