Skip to content

handle parameter for Connection in tokio-postgres #268

Open
@adam0z

Description

@adam0z

I would like to start using async postgres with my async RPC method.
I need to pass a tokio_core::reactor::Handle to connect method:
https://github.com/sfackler/rust-postgres/blob/master/tokio-postgres/src/lib.rs#L299

In tokio-postgres examples they get a handle from:

let mut core = Core::new().unwrap();
let handle = core.handle();

I assume that I should not do it that way, but I attached a file with async method with this code.
rpc_impl.txt

How can I access a handle (I guess to event loop) inside a RPC method?
What should I change in my code?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions