from clarabot_nano_common.utility.serialize import uint2bytes

KEEPALIVE_INTERVAL = 1.0
KEEPALIVE_FAILURE = KEEPALIVE_INTERVAL * 10

QUEUE_PUSH_NOTIFICATION = b"QPN"

# for client request-reply pattern
REQUEST_MESSAGE = b"REQ"
REPLY_MESSAGE = b"REP"
NOTIFY_ID = uint2bytes(0)  # request id that indicates to omit reply

# In some cases one server may need to communicate with another (like FSTX) to complete its goals.
# Such internal requests are routed through the gateway. The processing can skip many caching/encryption
# steps for efficiency, so they have a separate handler to invoke.
# Using a separate request marker lets the processing fork off early and clearly.
INTERNAL_REQUEST_MESSAGE = b"IRQ"
