"""Two tasks: a producer of squares and a consumer that prints them, then ends the program."""

from verada import sleep, stop, task

from buffers import shared


@task
def producer() -> None:
    for i in range(1, 6):
        shared.put(i * i)
    while True:
        sleep(1.0)


@task
def consumer() -> None:
    for _ in range(5):
        x: int = shared.get()
        print("got", x)
    stop()
    while True:
        sleep(1.0)
