File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Python connector and ORM for ThingsDB
1+ # Python connector for ThingsDB
22
33> This library requires Python 3.6 or higher.
44
55---------------------------------------
66
77 * [ Installation] ( #installation )
88 * [ Quick usage] ( #quick-usage )
9- * [ Client module] ( #client-module )
10- * [ Client()] ( #Client )
9+ * [ Client] ( #client )
1110 * [ authenticate] ( #authenticate )
1211 * [ close] ( #close )
1312 * [ connect] ( #connect )
@@ -74,14 +73,12 @@ async def hello_world():
7473asyncio.get_event_loop().run_until_complete(hello_world())
7574```
7675
77- # # Client module
76+ # # Client
7877
7978This is an client using `asyncio` which can be used for running queries to
8079ThingsDB.
8180
8281
83- # ## Client()
84-
8582```python
8683thingsdb.client.Client(
8784 auto_reconnect: bool = True ,
@@ -454,10 +451,20 @@ chat = Chat("""//ti
454451 .chat.id();
455452""" )
456453
454+
457455# Now we can join the room. (we assume that you have a ThingsDB client)
458456await chat.join(client)
459457```
460458
459+ # ### Room Init Args
460+ - * room (int / str )* :
461+ The room Id or ThingsDB code which returns the Id of the room.
462+ Examples are `123 ` , `' .my_room.id();' `
463+ - * scope (str )* :
464+ Collection scope. If no scope is given, the scope will later
465+ be set to the default client scope once the room is joined.
466+
467+
461468# # Room Methods
462469
463470Besides implementing an `@ event` handler, a room has also some methods which can be implemented to control or initialize a room.
Original file line number Diff line number Diff line change @@ -435,6 +435,9 @@ def _emit(
435435 ) -> asyncio .Future :
436436 """Emit an event.
437437
438+ Use Room(room_id, scope=scope).emit(..) instead of this function to
439+ emit an event to a roomId.
440+
438441 Args:
439442 room_id (int):
440443 Room Id to emit the event to.
You can’t perform that action at this time.
0 commit comments