edgeport - v1.0.6
    Preparing search index...

    Function connect

    • Connects to a Redis server, authenticates, and returns a live session.

      Dials the core transport, runs the handshake for the requested protocol version (HELLO 3 for protocol: 3, otherwise AUTH), optionally selects a database, then starts the background pump that routes replies and Pub/Sub deliveries.

      Parameters

      Returns Promise<RedisSession>

      The live session.

      If the server rejects the credentials.

      If the connection cannot be established.

      If the server cannot speak the requested protocol version.

      If the handshake exceeds the deadline.

      1.0.6

      import { connect } from 'edgeport/redis';

      await using redis = await connect({ hostname: 'redis.example.com', password: env.REDIS_PASSWORD });
      await redis.set('visits', 0);
      const visits = await redis.incr('visits');
      const greeting = await redis.getText('greeting');