migueldeicaza / SwiftTermApp

MIT License
309 stars 29 forks source link

EAGAIN in libssh2 #96

Closed migueldeicaza closed 2 years ago

migueldeicaza commented 2 years ago

Currently, everything loops when there is an EAGAIN - but perhaps this is wrong, perhaps I should be writing async functions that suspend on these conditions, and resume later. This would be so the sshQueue work does not get clogged with potentially blocking operations (say, transferring a file)

If we were to use async as described here:

https://forums.swift.org/t/async-design-challenge/55052/7

I would also likely need to change class Session to actor Session and likely have to fold the various session implementations into a single class. Or have a SessionActor instance purely to call the methods in libssh2 for the session and their channels.

migueldeicaza commented 2 years ago

Done.