Upstream Hybrid is stagnant and there isn't much motivation to add new features on our own accord. This page holds the discussion for the designs and features we would want to see in our new implementation. The project is to be done in Python (with possibly a few modules in C) the idea being Python provides a higher probability for new contributors. Because of the use of Python performance is worrisome, to that end we'll be utilizing stackless python preferring tasklets to actual threads.
Basic Tasklets
- Tasklet Per Listener
- Tasklet Per Connection (user and server) this handles reading from respective sockets and flushing send queues
- received data is pushed via message_processor channel
- Message Processor tasklet blocks and waits on data from to become available on the message_processor channel transforms to valid callable command and schedules execution
- Event Service maintains a list of timer processes, how often they should run, when they were last run, dispatches those events
Server <-> Server Protocol
We have complete control of this portion, I think it should largely be ignored during the design phase. Ideally we want multiple server links, message acknowledgement (dunno), and usage of something more along the lines of RPC for message passing between servers.
Class Layout
- User
- nick
- user
- host
- cloak
- mode
- channels
- - (hybrid uses Memberships which are basically the union of channels and members)
- certfp
- sendq
- - virtual, each subclass determines how to send the user
LocalUser(User)
- socket
- sendq
RemoteUser(User)
- sendq
- Channel
- name
- mode
- topic
- users
- bans (bans[MODE] = [])
- Command
- name
- metrics
- execute
- Listener
- socket
- flags(ssl, zip, hidden)
- key
- cert
- - Message Processor finds proper class descendent of command should it immediately execute or schedule command?
Basic Principles
- Listener is just that, a wrapper around the socket that accepts TCP(currently) connections. It handles the low level stuff, ssl, zip etc). It has a protocol objected which is created on listener init. When a connection is accepted a peer is created and passed through a channel to the server instance.
- Peer is a wrapper around a socket. It deals with the raw TCP(currently) data in and out.
- Protocol is a class which defines how stuff is sent over the network in response to other stuff.
