mirror of
https://github.com/vale981/ray
synced 2025-03-09 04:46:38 -04:00
18 lines
278 B
Python
18 lines
278 B
Python
from ray import serve
|
|
|
|
import logging
|
|
|
|
logger = logging.getLogger("ray.serve")
|
|
|
|
|
|
@serve.deployment
|
|
class Counter:
|
|
def __init__(self):
|
|
self.count = 0
|
|
|
|
async def __call__(self, request):
|
|
self.count += 1
|
|
return self.count
|
|
|
|
|
|
counter = Counter.bind()
|