Skip to content

feat: Use explicit lifetime for RpcFunc, thus allowing non-static lifetimes#5

Merged
frol merged 1 commit intoelast0ny:masterfrom
frol:feature/allow-non-static-handlers
Oct 15, 2020
Merged

feat: Use explicit lifetime for RpcFunc, thus allowing non-static lifetimes#5
frol merged 1 commit intoelast0ny:masterfrom
frol:feature/allow-non-static-handlers

Conversation

@frol
Copy link
Copy Markdown
Collaborator

@frol frol commented Oct 4, 2020

This change is not effective if you spawn evt_loop with tokio::spawn as the latter requires 'static lifetime, so it poisons the client, and the core with 'static requirement. I ended up using Arc for the context state anyway, so these changes are not solving any particular issue, but I still think it might be worth having it specified this way to potentially relax some future use-cases.

…etimes

This change is not effective if you spawn `evt_loop` with `tokio::spawn`
as the latter requires `'static` lifetime, and it poisones the client,
and the core with `'static` requirement. I ended up using `Arc` for the
context state anyway, so these changes are not solving any particular
issue, but I still think it might be worth having it specified this way
to potentially relax some future use-cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant