Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShardConfig::builder issues with queue configuration function #101

Closed
NovusTheory opened this issue Feb 11, 2020 · 0 comments · Fixed by #103
Closed

ShardConfig::builder issues with queue configuration function #101

NovusTheory opened this issue Feb 11, 2020 · 0 comments · Fixed by #103
Assignees
Labels
c-gateway Affects the gateway crate t-bug Programming error in the library

Comments

@NovusTheory
Copy link

This could be a simple mistake on my part or something counter-intuitive but looking at the function I should be able to just provide something simple like Box::new(Queue::new()). Except this doesn't work.

A bare bones example is importing dawn-gateway and only dawn-gateway like so dawn-gateway = { git = "https://github.com/dawn-rs/dawn" } then providing the built-in LocalQueue from dawn as a reproductive example.

use dawn_gateway::{Shard, ShardConfig, queue::LocalQueue};

let token = env::var("DISCORD_TOKEN")?;
let config = ShardConfig::builder(&token);
config.queue(Box::new(LocalQueue::new()));

I would assume this would work and be how it's performed as per this line doing this exact thing, just outside the function https://github.com/dawn-rs/dawn/blob/cc35c8532171ab1e02f7a5cf664599e50465107f/gateway/src/shard/config.rs#L105

@Erk- Erk- self-assigned this Feb 11, 2020
@Erk- Erk- added t-bug Programming error in the library c-gateway Affects the gateway crate labels Feb 11, 2020
Erk- added a commit to Erk-/twilight that referenced this issue Feb 13, 2020
Made the queue an Arc to make sure that all shards in a cluster use
the same queue.

Loosend a trait bound to make it easier to work with queues.
(fixes twilight-rs#101)

Also added a example with a very bad, but custom queue.

Signed-off-by: Valdemar Erk <valdemar@erk.io>
Erk- added a commit to Erk-/twilight that referenced this issue Feb 13, 2020
Made the queue an Arc to make sure that all shards in a cluster use
the same queue.

Loosend a trait bound to make it easier to work with queues.
(fixes twilight-rs#101)

Also added a example with a very bad, but custom queue.

Signed-off-by: Valdemar Erk <valdemar@erk.io>
Erk- added a commit to Erk-/twilight that referenced this issue Feb 13, 2020
Made the queue an Arc to make sure that all shards in a cluster use
the same queue.

Loosend a trait bound to make it easier to work with queues.
(fixes twilight-rs#101)

Also added a example with a very bad, but custom queue.

Signed-off-by: Valdemar Erk <valdemar@erk.io>
Erk- added a commit to Erk-/twilight that referenced this issue Feb 17, 2020
Made the queue an Arc to make sure that all shards in a cluster use
the same queue.

Loosend a trait bound to make it easier to work with queues.
(fixes twilight-rs#101)

Also added a example with a very bad, but custom queue.

Signed-off-by: Valdemar Erk <valdemar@erk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-gateway Affects the gateway crate t-bug Programming error in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants