Documentation
¶
Overview ¶
Copyright (c) 2022 Bruce Zhang
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
View Source
const ( ErrEvents = unix.EPOLLERR | unix.EPOLLHUP | unix.EPOLLRDHUP // OutEvents combines EPOLLOUT event and some exceptional events. OutEvents = ErrEvents | unix.EPOLLOUT // InEvents combines EPOLLIN/EPOLLPRI events and some exceptional events. InEvents = ErrEvents | unix.EPOLLIN | unix.EPOLLPRI )
Variables ¶
View Source
var SubReactorsNum = 2
Functions ¶
func Run ¶
func Run(eventHandler EventHandler, protoAddr string, optList ...Option)
Types ¶
type BuiltinEventHandler ¶
type BuiltinEventHandler struct {
}
func (BuiltinEventHandler) OnClose ¶
func (builtinEventHandler BuiltinEventHandler) OnClose(c Conn)
func (BuiltinEventHandler) OnConn ¶
func (builtinEventHandler BuiltinEventHandler) OnConn(c Conn)
type Conn ¶
type EventHandler ¶
type MainReactor ¶
type MainReactor struct {
// contains filtered or unexported fields
}
func (*MainReactor) Init ¶
func (mr *MainReactor) Init(proto, addr string) error
Create poller and listener for mainReactor
func (*MainReactor) Loop ¶
func (mainReactor *MainReactor) Loop()
func (*MainReactor) SetEventHandler ¶
func (mr *MainReactor) SetEventHandler(eh EventHandler)
type PollAttachment ¶
type PollAttachment struct {
Fd int
Event unix.EpollEvent
}
type Poller ¶
type Poller struct {
Fd int
}
func (*Poller) AddPollRead ¶
type SubReactor ¶
type SubReactor struct {
// contains filtered or unexported fields
}
func (*SubReactor) Loop ¶
func (sr *SubReactor) Loop()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
