dashboard/state_aggregator.py
async def list_workers(self, *, option: ListApiOptions) -> dict:
        """List all worker information from the cluster.

        Returns:
            {worker_id -> worker_data_in_dict}
            worker_data_in_dict's schema is in WorkerState
        """
        reply = await self._client.get_all_worker_info(timeout=option.timeout)
        result = []
        for message in reply.worker_table_data:
            data = self._message_to_dict(
                message=message, fields_to_decode=["worker_id"]
            )
            data["worker_id"] = data["worker_address"]["worker_id"]
            data = filter_fields(data, WorkerState)
            result.append(data)

        # Sort to make the output deterministic.
        result.sort(key=lambda entry: entry["worker_id"])
        return {d["worker_id"]: d for d in islice(result, option.limit)}
List all worker information from the cluster.

        Returns:
            {worker_id -> worker_data_in_dict}
            worker_data_in_dict's schema is in WorkerState
        
List all worker information from the cluster.
List all worker information from the cluster .
async def list_workers(self, *, option: ListApiOptions) -> dict:
        reply = await self._client.get_all_worker_info(timeout=option.timeout)
        result = []
        for message in reply.worker_table_data:
            data = self._message_to_dict(
                message=message, fields_to_decode=["worker_id"]
            )
            data["worker_id"] = data["worker_address"]["worker_id"]
            data = filter_fields(data, WorkerState)
            result.append(data)
        result.sort(key=lambda entry: entry["worker_id"])
        return {d["worker_id"]: d for d in islice(result, option.limit)}
async def list_workers ( self , * , option : ListApiOptions ) -> dict : reply = await self . _client . get_all_worker_info ( timeout = option . timeout ) result = [ ] for message in reply . worker_table_data : data = self . _message_to_dict ( message = message , fields_to_decode = [ "worker_id" ] ) data [ "worker_id" ] = data [ "worker_address" ] [ "worker_id" ] data = filter_fields ( data , WorkerState ) result . append ( data ) result . sort ( key = lambda entry : entry [ "worker_id" ] ) return { d [ "worker_id" ] : d for d in islice ( result , option . limit ) }
List all worker information from the cluster.
List all worker information from the cluster .
"""List all worker information from the cluster.

        Returns:
            {worker_id -> worker_data_in_dict}
            worker_data_in_dict's schema is in WorkerState
        """ # Sort to make the output deterministic.
{worker_id -> worker_data_in_dict}
worker_data_in_dict's schema is in WorkerState
{ worker_id - > worker_data_in_dict } worker_data_in_dict ' s schema is in WorkerState
self
option
ListApiOptions