Skip to content

Commit

Permalink
feat: ServerClient.info() returns more info
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Oct 15, 2023
1 parent 1560463 commit b99b8cf
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions htagweb/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,17 @@ async def update(actions):
log("tag.update not possible (http only)")
#======================================

await registerHrProcess(bus,hid,FactorySession.__name__,pid)
time_activity = time.monotonic()

await registerHrProcess(bus,hid,dict(
sesprovider=FactorySession.__name__,
pid=pid,
timeout_inactivity=timeout_inactivity,
http_only = not useUpdate,
timestamp = time_activity,
)
)

try:

# publish the 1st rendering
Expand Down Expand Up @@ -208,12 +217,12 @@ async def update(actions):
asyncio.run( loop() )
log("end")

async def registerHrProcess(bus,hid:Hid,sesprovider:str,pid:int):
async def registerHrProcess(bus,hid:Hid,info:dict):
# register hid in redys "apps"
await bus.sadd(KEYAPPS,str(hid))

# save sesprovider for this hid
await bus.set(hid.KEY_SYSINFO, dict(sesprovider=sesprovider,pid=pid))
await bus.set(hid.KEY_SYSINFO, info)

# subscribe for interaction
await bus.subscribe( hid.EVENT_INTERACT )
Expand Down Expand Up @@ -283,11 +292,8 @@ async def session(self,hid:Hid) -> dict:
return FactorySession(hid.uid)

async def info(self,hid:Hid) -> dict:
""" get info from hid"""
sesinfo=await self._bus.get(hid.KEY_SYSINFO)
return dict(
pid=sesinfo["pid"],
)
""" get infos from hid"""
return await self._bus.get(hid.KEY_SYSINFO)


##################################################################################
Expand Down

0 comments on commit b99b8cf

Please sign in to comment.