Skip to content

Commit 3250731

Browse files
committed
Upd readme
1 parent 23a70e1 commit 3250731

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
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():
7473
asyncio.get_event_loop().run_until_complete(hello_world())
7574
```
7675

77-
## Client module
76+
## Client
7877

7978
This is an client using `asyncio` which can be used for running queries to
8079
ThingsDB.
8180

8281

83-
### Client()
84-
8582
```python
8683
thingsdb.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)
458456
await 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

463470
Besides implementing an `@event` handler, a room has also some methods which can be implemented to control or initialize a room.

thingsdb/client/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)