~emersion/soju#71: 
IDLE command, to save battery life on phones

Below is a specification draft for the IDLE command. See Motivation for the use-case.


#Motivation

When connecting to soju from a phone for a long period of time, battery consumption becomes too high. This is mainly because every message soju sends results in a wake-up of downstream's antenna and CPU. The IDLE command allows a client to tell soju to send messages sparsely, so that the number of wake-ups is reduced.

#Description

The IDLE command is a command that can only be sent by clients. It has an optional parameter: a list of comma (,) separated nicknames, called highlights.

Servers MAY advertise the IDLE ISUPPORT token. This token has no value. Servers that advertise this token support the IDLE command.

When a server receives the IDLE command from a client, its connection with the client becomes idle. When a server receives a command other than IDLE from a client with an idle connection, the connection becomes back to normal (not idle).

When a connection is idle, messages to be sent to the client are buffered on the server until one of the following happens:

  • the server buffers a PRIVMSG or NOTICE whose content contains one of the highlights or whose target is the client,
  • the server cannot buffer any more messages.

In this case, the server sends all buffered messages to the client, and starts buffering messages again.

#Examples

Case of a client that makes a connection idle, then turns it back to normal with a ping:

C: IDLE taiite,taite,hhirtz
C: PING 25E3CFB
Status
REPORTED
Submitter
~taiite
Assigned to
No-one
Submitted
4 months ago
Updated
2 months ago
Labels
downstream enhancement

~taiite 4 months ago

Changed, as per delthas and emersion's request

In this case, the server sends all buffered messages to the client in as few TCP segments as possible, and starts buffering messages again.

to

In this case, the server sends all buffered messages to the client, and starts buffering messages again.

~taiite 3 months ago

Changed, as per Sir Delthas' forceful (doki doki) demand

- the server buffers a PRIVMSG or NOTICE whose content contains one of
the highlights, whose source is the client or whose target is the client,

to

- the server buffers a PRIVMSG or NOTICE whose content contains one of
the highlights or whose target is the client,

~nomeji 2 months ago

To help tracking improvement I'm sharing battery usage on my phone in different use case. This showcase that the battery consumtion is excessive.

Client connected to soju with an upstream with lots of messages:

lot msg 1 lot msg 2

Client connected to soju with an upstream with no messages at all:

few msg 1 few msg 2

Register here or Log in to comment, or comment via email.