DBConnection behaviour implementation for NebulaGraph.
Each connection in the pool owns one TCP (or TLS) socket and one authenticated NebulaGraph session. The session ID is held in the connection state and is automatically reused for every query checked out from the pool.
You should not use this module directly — NebulaGraphEx.Graph is the
public interface. This module is documented for library developers who want
to understand the connection lifecycle or implement custom pool strategies.
Connection lifecycle
connect/1— opens the socket, performs the version handshake, and authenticates to get asession_id.ping/1— executesYIELD 1to keep the session alive. Called byDBConnectionon idle connections at:idle_interval.handle_execute/4— encodes and sends the query, decodes the response into%NebulaGraphEx.Result{}.disconnect/2— signs out the session and closes the socket.
Connection state
The state map held by DBConnection:
:socket— the:gen_tcpor:sslsocket:session_id— integer NebulaGraph session ID:opts— resolved pool options fromNebulaGraphEx.Options:seq— monotonically incrementing Thrift sequence number