add cable but not complete
This commit is contained in:
8
app/jobs/order_broadcast_job.rb
Normal file
8
app/jobs/order_broadcast_job.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class OrderBroadcastJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(message)
|
||||
order = Order.find(message) # message come as order_id
|
||||
ApplicationCable.server.broadcast "order_queue_station_channel", order: order
|
||||
end
|
||||
end
|
||||
@@ -3,8 +3,9 @@ class OrderQueueProcessorJob < ApplicationJob
|
||||
|
||||
def perform(order_id)
|
||||
# Do something later
|
||||
#Order ID
|
||||
#Order ID
|
||||
order = Order.find(order_id)
|
||||
|
||||
#Loop through the order stations and process the items
|
||||
#Execute orders and send to order stations
|
||||
if order
|
||||
|
||||
Reference in New Issue
Block a user