Closed rakshasa closed 10 years ago
Could you give us a code snippet that describes the use-cases of this functionality.
class Controller < Trema::Controller
include TremaTasks
end
class DpInfo
def add_flows(flows)
return if flows.blank?
@controller.pass_task {
flows.each { |flow|
@controller.send_flow_mod_add(@dpid, flow.to_trema_hash)
}
}
end
end
By calling 'add_flows' any thread can safely pass a set of flows to the trema thread, in the context which the Controller is running.
I see. Thanks for the patch.
Added support for thread safe passing of ruby blocks for execution in the Trema thread context.