File: producer.py

package info (click to toggle)
python-pykka 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: python: 2,817; makefile: 113
file content (11 lines) | stat: -rw-r--r-- 260 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
import pykka


class ProducerActor(pykka.ThreadingActor):
    def __init__(self, consumer):
        super().__init__()
        self.consumer = consumer

    def produce(self):
        new_item = {"item": 1, "new": True}
        self.consumer.consume(new_item)