vapor-community / postgresql

Robust PostgreSQL interface for Swift
MIT License
131 stars 33 forks source link

Using Listen Leads To Crashes #51

Open e450 opened 7 years ago

e450 commented 7 years ago

Libpq docs say connections should not be shared between threads.

Some example error messages: message type 0x31 arrived from server while idle message type 0x32 arrived from server while idle message type 0x54 arrived from server while idle PostgreSQL Error: Unknown

Also, the sleep(1) poll loop makes this useless for most things. It should use a select call because most of the time people are using notify for timely notification.