Giter Club home page Giter Club logo

gluon's Introduction

Gluon

Simple Discord API Library for Quark

https://quark-bot-discord.github.io/gluon/

https://gluon.quark.bot/

Info

Purpose

Gluon is a library made specifically for Quark, so only has options to cache anything that Quark needs to cache. Many things are missing from this library. There are also options to further refine caching, in order to minimise memory usage. Some structures are also stored in "weird" ways in order to optimise memory usage, such as the use of bitfields in order to store groups of binary fields or ids being stored as BigInts rather than strings.

Bugs

Gluon has been used in Quark for well over a year, and most bugs have been ironed out over this time.

Structure

Gluon is intended to be very similar in terms of structure to Discord.JS, so that switching from Discord.JS to Gluon requires minimal modifications. It should be noted that the behaviour of these two libraries are very different, and this should be considered when converting.

IDs for related structures

Where possible, Gluon will try to attach the structure of related resources. For example, attaching a channel object to a message. However, if these related structures are not being actively cached (the channel not being cached in this example), it is not possible to attach these structures. If that structure is not present, Gluon will always provide the id of the related structure instead (either/or).

gluon's People

Contributors

misly16 avatar starman3787 avatar thatkev avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

thatkev

gluon's Issues

add typings

to make it considerably easier to find your way around the lib

ratelimits

quark seems to get ratelimited very very occasionally, with <1 second left before another request can be made

likely due to network latency, and definitely something that should be accounted for

dynamically calculating this seems like the best way

selective caching

decide how it can be determined whether certain things should be cached for certain guilds

perhaps attach the gData structure to the guild, and determine from there?/more integration between the guild and gData structures

request queues can get stuck

there is no recovery mechanism for if a queue gets stuck, requests just keep getting added indefinitely while no further requests are made

guild create event

prevent guilds which have just recovered from being unavailable from being emitted again - should note if a guild is unavailable

allow a/b testing

let shard ids be provided to the client, so the bot can give different responses for different servers

rolling/zero-downtime restarts

implement or allow a way to perform rolling/zero-downtime restarts

  • perhaps could try restarting on the reconnect event? would avoid the issue of hitting the IDENTIFY limit
  • ideally (and if we were to use the reconnect event) things should stay cached between restarts (and apparently "reloading" modules/files is not a great idea and can cause memory issues, so i would prefer to avoid that if possible)

add different run modes

"dev" - lots of logging
"prod" - no logging, process should continue running even if an error is encountered
"shadow" - runs in the background. everything happens as it usually would, except requests which cause an action are not made. needed for stress and stability testing

clustering/process management

provide a quick and easy way of starting the bot on multiple processes, some of which may run slightly different code (for a/b testing)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.