InfText.Session

g GObject.GInterface GObject.GInterface Infinity.CommunicationObject Infinity.CommunicationObject GObject.GInterface->Infinity.CommunicationObject GObject.Object GObject.Object Infinity.Session Infinity.Session GObject.Object->Infinity.Session InfText.Session InfText.Session Infinity.AdoptedSession Infinity.AdoptedSession Infinity.AdoptedSession->InfText.Session Infinity.CommunicationObject->Infinity.Session Infinity.Session->Infinity.AdoptedSession

Subclasses:

None

Methods

Inherited:

Infinity.AdoptedSession (7), Infinity.Session (19), GObject.Object (37), Infinity.CommunicationObject (3)

Structs:

GObject.ObjectClass (5)

class

join_user (proxy, name, status, hue, caret_position, selection_length, func, *user_data)

class

new (manager, buffer, io, status, sync_group, sync_connection)

class

new_with_user_table (manager, buffer, io, user_table, status, sync_group, sync_connection)

flush_requests_for_user (user)

set_user_color (user, hue)

Virtual Methods

Inherited:

Infinity.AdoptedSession (2), Infinity.Session (11), GObject.Object (7), Infinity.CommunicationObject (3)

Properties

Inherited:

Infinity.AdoptedSession (3), Infinity.Session (7)

Name

Type

Flags

Short Description

caret-update-interval

int

r/w/c

Minimum number of milliseconds between caret update broadcasts

Signals

Inherited:

Infinity.AdoptedSession (1), Infinity.Session (6), GObject.Object (1)

Fields

Inherited:

Infinity.AdoptedSession (1), Infinity.Session (6), GObject.Object (1)

Name

Type

Access

Description

parent

Infinity.AdoptedSession

r

Class Details

class InfText.Session(**kwargs)
Bases:

Infinity.AdoptedSession

Abstract:

No

Structure:

InfText.SessionClass

classmethod join_user(proxy, name, status, hue, caret_position, selection_length, func, *user_data)
Parameters:
Returns:

A Infinity.Request, or None.

Return type:

Infinity.Request

This functions creates a user join request for an InfText.Session. This is a shortcut for Infinity.SessionProxy.join_user().

classmethod new(manager, buffer, io, status, sync_group, sync_connection)
Parameters:
Returns:

A new InfText.Session.

Return type:

InfText.Session

Creates a new InfText.Session. The communication manager is used to send and receive requests from subscription and synchronization. buffer will be set to be initially empty if the session is initially synchronized (see below). io is required to trigger timeouts.

If status is Infinity.SessionStatus.PRESYNC or Infinity.SessionStatus.SYNCHRONIZING, then the session will initially be sychronized, meaning the initial content is retrieved from sync_connection. If you are subscribed to the session, set the subscription group via Infinity.Session.set_subscription_group().

classmethod new_with_user_table(manager, buffer, io, user_table, status, sync_group, sync_connection)
Parameters:
Returns:

A new InfText.Session.

Return type:

InfText.Session

Creates a new InfText.Session. The connection manager is used to send and receive requests from subscription and synchronization. buffer will be set to be initially empty if the session is initially synchronized (see below). io is required to trigger timeouts.

If status is Infinity.SessionStatus.PRESYNC or Infinity.SessionStatus.SYNCHRONIZING, then the session will initially be sychronized, meaning the initial content is retrieved from sync_connection. If you are subscribed to the session, set the subscription group via Infinity.Session.set_subscription_group().

user_table is used as an initial user table. The user table should only contain unavailable users, if any, that may rejoin during the session. If there was an available user in the user table, it would probably belong to another session, but different sessions cannot share the same user object.

flush_requests_for_user(user)
Parameters:

user (InfText.User) – The InfText.User for which to flush messages.

This function sends all pending requests for user immediately. Requests that modify the buffer are not queued normally, but cursor movement requests are delayed in case are issued frequently, to save bandwidth.

The main purpose of this function is to send all pending requests before changing a user’s status to inactive or unavailable since inactive users are automatically activated as soon as they issue a request.

TODO: We should probably detect this automatically, without requiring people to call this function, i.e. flush requests for local users just before they become inactive.

user must have the Infinity.UserFlags.LOCAL flag set.

set_user_color(user, hue)
Parameters:
  • user (InfText.User) – A local InfText.User from self's user table.

  • hue (float) – New hue value for user's color. Ranges from 0.0 (red) to 1.0 (red).

Changes the user color of user. user must have the Infinity.UserFlags.LOCAL flag set.

Property Details

InfText.Session.props.caret_update_interval
Name:

caret-update-interval

Type:

int

Default Value:

500

Flags:

READABLE, WRITABLE, CONSTRUCT

Minimum number of milliseconds between caret update broadcasts