Skip to content

Commit

Permalink
Add support for 'mempool' room in socket connections
Browse files Browse the repository at this point in the history
Included the 'mempool' room in the list of valid rooms, and implemented event handling to emit mempool data when a user joins the 'mempool' room. This enhances the socket's capabilities to provide real-time mempool updates.
  • Loading branch information
lAmeR1 committed Nov 9, 2024
1 parent 0064253 commit d8d5586
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sockets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from sockets.blockdag import emit_blockdag
from sockets.bluescore import emit_bluescore
from sockets.coinsupply import emit_coin_supply
from sockets.mempool import emit_mempool

VALID_ROOMS = ["blocks", "coinsupply", "blockdag", "bluescore"]
VALID_ROOMS = ["blocks", "coinsupply", "blockdag", "bluescore", "mempool"]


@sio.on("join-room")
Expand All @@ -23,3 +24,5 @@ async def join_room(sid, room_name):
if room_name == "bluescore":
await emit_bluescore()

if room_name == "mempool":
await emit_mempool()

0 comments on commit d8d5586

Please sign in to comment.