Skip to content

Something is not Sync about AsyncStream (PgNotifications) #303

@crocme10

Description

@crocme10

Hello,

I am trying to publish Postgres notifications using Server Sent Events (SSE). I have sqlx to connect to Postgres, and warp to server SSEs.

The code does not compile, complaining that something is not Sync, and breaks the requirements on the function reply

dyn core::future::future::Future<Output = std::result::Result<(), sqlx_core::error::Error>> + std::marker::Send` cannot be shared between threads safely

I am not sure where this problem originates, as sqlx::Error is Sync, PgNotification is Sync....

Thank you for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions