upgrade phony dependency and switch to its new interface

This commit is contained in:
Arceliar 2019-08-25 10:36:09 -05:00
parent cff1366146
commit aa30c6cc98
10 changed files with 54 additions and 54 deletions

View file

@ -320,7 +320,7 @@ func (intf *linkInterface) handler() error {
isAlive = true
if !isReady {
// (Re-)enable in the switch
intf.link.core.switchTable.EnqueueFrom(nil, func() {
intf.link.core.switchTable.RecvFrom(nil, func() {
intf.link.core.switchTable._idleIn(intf.peer.port)
})
isReady = true
@ -359,7 +359,7 @@ func (intf *linkInterface) handler() error {
isReady = false
} else {
// Keep enabled in the switch
intf.link.core.switchTable.EnqueueFrom(nil, func() {
intf.link.core.switchTable.RecvFrom(nil, func() {
intf.link.core.switchTable._idleIn(intf.peer.port)
})
isReady = true
@ -390,7 +390,7 @@ func (intf *linkInterface) handler() error {
}
}()
// Run reader loop
var helper phony.Actor
var helper phony.Inbox
done := make(chan struct{})
var helperFunc func()
helperFunc = func() {
@ -417,10 +417,10 @@ func (intf *linkInterface) handler() error {
default:
}
// Now try to read again
helper.EnqueueFrom(nil, helperFunc)
helper.RecvFrom(nil, helperFunc)
}
// Start the read loop
helper.EnqueueFrom(nil, helperFunc)
helper.RecvFrom(nil, helperFunc)
<-done // Wait for the helper to exit
////////////////////////////////////////////////////////////////////////////////
// Remember to set `err` to something useful before returning