chatflock.backing_stores.in_memory¶
Module Contents¶
- class chatflock.backing_stores.in_memory.InMemoryChatDataBackingStore(messages=None, participants=None)¶
Bases:
chatflock.base.ChatDataBackingStoreHelper class that provides a standard way to create an ABC using inheritance.
- Parameters:
messages (Optional[List[chatflock.base.ChatMessage]])
participants (Optional[List[chatflock.base.ChatParticipant]])
- messages: List[chatflock.base.ChatMessage]¶
- participants: Dict[str, chatflock.base.ChatParticipant]¶
- get_messages()¶
- Return type:
- add_message(sender_name, content, timestamp=None)¶
- Parameters:
sender_name (str)
content (str)
timestamp (Optional[datetime.datetime])
- Return type:
- clear_messages()¶
- get_active_participants()¶
- Return type:
- get_non_active_participants()¶
- Return type:
- get_active_participant_by_name(name)¶
- Parameters:
name (str)
- Return type:
Optional[chatflock.base.ActiveChatParticipant]
- get_non_active_participant_by_name(name)¶
- Parameters:
name (str)
- Return type:
Optional[chatflock.base.ChatParticipant]
- add_participant(participant)¶
- Parameters:
participant (chatflock.base.ChatParticipant)
- Return type:
None
- remove_participant(participant)¶
- Parameters:
participant (chatflock.base.ChatParticipant)
- Return type:
None
- has_active_participant_with_name(participant_name)¶