mirror of
https://github.com/vale981/ray
synced 2025-03-10 13:26:39 -04:00

Current logs API simply returns a str to unblock development and integration. We should add proper log streaming for better UX and external job manager integration. Co-authored-by: Sven Mika <sven@anyscale.io> Co-authored-by: sven1977 <svenmika1977@gmail.com> Co-authored-by: Ed Oakes <ed.nmi.oakes@gmail.com> Co-authored-by: Richard Liaw <rliaw@berkeley.edu> Co-authored-by: Simon Mo <simon.mo@hey.com> Co-authored-by: Avnish Narayan <38871737+avnishn@users.noreply.github.com> Co-authored-by: Jiao Dong <jiaodong@anyscale.com>
25 lines
380 B
Python
25 lines
380 B
Python
import ray
|
|
import requests
|
|
|
|
ray.init()
|
|
|
|
|
|
@ray.remote
|
|
class Counter:
|
|
def __init__(self):
|
|
self.counter = 0
|
|
|
|
def inc(self):
|
|
self.counter += 1
|
|
|
|
def get_counter(self):
|
|
return self.counter
|
|
|
|
|
|
counter = Counter.remote()
|
|
|
|
for _ in range(5):
|
|
ray.get(counter.inc.remote())
|
|
print(ray.get(counter.get_counter.remote()))
|
|
|
|
print(requests.__version__)
|