mirror of
https://github.com/vale981/ray
synced 2025-03-10 13:26:39 -04:00
19 lines
278 B
Python
19 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()
|