Extend `.msg.types.Aid` method interface
Providing the legacy `.uid -> tuple` style id (since still used for the `Actor._contexts` table) and a `repr-one-line` method `.reprol() -> str` for rendering a compact unique actor ID summary (useful in logging/.pformat()s at the least).to_asyncio_eoc_signal
							parent
							
								
									ec13c1b31d
								
							
						
					
					
						commit
						1c9293e69d
					
				|  | @ -154,6 +154,29 @@ class Aid( | |||
|     #     should also include at least `.pid` (equiv to port for tcp) | ||||
|     #     and/or host-part always? | ||||
| 
 | ||||
|     @property | ||||
|     def uid(self) -> tuple[str, str]: | ||||
|         ''' | ||||
|         Legacy actor "unique-id" pair format. | ||||
| 
 | ||||
|         ''' | ||||
|         return ( | ||||
|             self.name, | ||||
|             self.uuid, | ||||
|         ) | ||||
| 
 | ||||
|     def reprol( | ||||
|         self, | ||||
|         sin_uuid: bool = True, | ||||
|     ) -> str: | ||||
|         if not sin_uuid: | ||||
|             return ( | ||||
|                 f'{self.name}[{self.uuid[:6]}]@{self.pid!r}' | ||||
|             ) | ||||
|         return ( | ||||
|             f'{self.name}@{self.pid!r}' | ||||
|         ) | ||||
| 
 | ||||
| 
 | ||||
| class SpawnSpec( | ||||
|     pretty_struct.Struct, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue