forked from Veliashvilii/threadsExample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroles.py
49 lines (40 loc) · 1.23 KB
/
roles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import threading
import time
class Customer(threading.Thread):
def __init__(self, id, priority):
super().__init__()
self.id = id
self.priority = priority
def run(self):
# Müşteri işlemleri
print(f"Customer {self.id} is seated.")
class Waiter(threading.Thread):
def __init__(self, id):
super().__init__()
self.id = id
def run(self):
# Garson işlemleri
print(f"Waiter {self.id} is taking an order.")
class Chef(threading.Thread):
def __init__(self, id):
super().__init__()
self.id = id
def run(self):
# Aşçı işlemleri
print(f"Chef {self.id} is preparing a dish.")
class Cashier(threading.Thread):
def __init__(self, id):
super().__init__()
self.id = id
def run(self):
# Kasa işlemleri
print(f"Cashier {self.id} is processing a payment.")
#time.sleep(10)
#table_number = input("What's your table number?\n")
#time.sleep(0.5)
print("Payment will starts")
class Table():
def __init__(self, id):
super().__init__()
self.id = id
self.isAvailable = True #Masanın dolu olup olmadığını kontrol etmek adına kullanılıyor.