# ``twisted`.`words`.`service`.`Group``

class documentation

`class Group: (source)`

Implements interfaces: `twisted.words.iwords.IGroup`

View In Hierarchy

Undocumented

Method | `__init__` | Undocumented
Method | `add` | Include the given user in this group.
Method | `iterusers` | Return an iterator of all users in this group.
Method | `receive` | Broadcast the given message from the given sender to other users in group.
Method | `remove` | Remove the given user from this group.
Method | `setMetadata` | Change the metadata associated with this group.
Method | `size` | Return the number of participants in this group.
Instance Variable | `meta` | Undocumented
Instance Variable | `name` | A short string, unique among groups.
Instance Variable | `users` | Undocumented
Method | `_cbUserCall` | Undocumented
Method | `_ebUserCall` | Undocumented

def __init__(self, name): (source)

Undocumented

def add(self, user): (source)
from `twisted.words.iwords.IGroup`
Include the given user in this group.

Parameters
user:`IUser` | Undocumented

def iterusers(self): (source)
from `twisted.words.iwords.IGroup`
Return an iterator of all users in this group.
def receive(self, sender, recipient, message): (source)
from `twisted.words.iwords.IGroup`

Broadcast the given message from the given sender to other users in group.

The message is not re-transmitted to the sender.

Parameters
sender | `IUser`
recipient:`IGroup` | This is probably a wart. Maybe it will be removed in the future. For now, it should be the group object the message is being delivered to.
message | `dict`
Returns
`twisted.internet.defer.Deferred` | A Deferred which fires with None when delivery has been attempted for all users.

def remove(self, user, reason=None): (source)
from `twisted.words.iwords.IGroup`
Remove the given user from this group.

Parameters
user:`IUser` | Undocumented
reason:`unicode` | Undocumented

def setMetadata(self, meta): (source)
from `twisted.words.iwords.IGroup`
Change the metadata associated with this group.

Parameters
meta:`dict` | Undocumented

def size(self): (source)
from `twisted.words.iwords.IGroup`
Return the number of participants in this group.

Returns
`twisted.internet.defer.Deferred` | A Deferred which fires with an `int` representing the number of participants in this group.

meta = (source)

Undocumented

name = (source)
from `twisted.words.iwords.IGroup`
A short string, unique among groups.
users: `dict` = (source)

Undocumented

def _cbUserCall(self, results): (source)

Undocumented

def _ebUserCall(self, err, p): (source)

Undocumented