Permalink
Browse files

Docs regressions

  • Loading branch information...
1 parent cb830e6 commit 0b6ccbe4954030c4c45c2f5068d68f53dc8d5d56 @methodmissing committed Jan 23, 2012
Showing with 165 additions and 5 deletions.
  1. +5 −5 README.rdoc
  2. +40 −0 lib/relp.rb
  3. +41 −0 lib/relp/client.rb
  4. +41 −0 lib/relp/server.rb
  5. +38 −0 lib/relp/version.rb
View
@@ -12,11 +12,11 @@ Caveats :
* Minor message duplication may occur if a network connection between the RELP client and RELP server breaks after the client could successfully send some messages but the server could not acknowledge them. Very very slim chance, but possible.
-It was initially designed for rsyslog-to-rsyslog communication, but can be used for various other applications. You can reference the protocol specification [here](http://www.librelp.com/relp.html)
+It was initially designed for rsyslog-to-rsyslog communication, but can be used for various other applications. You can reference the protocol specification {here}[http://www.librelp.com/relp.html]
== About librelp
-Quote from the librelp [homepage](http://www.librelp.com/) :
+Quote from the librelp {homepage}[http://www.librelp.com/] :
"librelp is an easy to use library for the RELP protocol. RELP in turn provides reliable event logging over the network (and consequently RELP stands for Reliable Event Logging Protocol). RELP was initiated by Rainer Gerhards after he was finally upset by the lossy nature of plain tcp syslog and wanted a cure for all these dangling issues."
@@ -46,7 +46,7 @@ Here's a few basic examples. Please refer to documentation (http://methodmissing
=== Low level API
-All protocol and connection state's kept within a single context, the Relp::Engine. An engine must be instantiated and passed as an initializer argument to Relp::Client and Relp::Server instances. Each of these roles also support a destroy method which will gracefully shutdown the engine and transfer state. This pretty much resembles the [rsyslog](http://rsyslog.com) Output / Input module design and we had to jump through some hoops in order to hide these details from the end user.
+All protocol and connection state's kept within a single context, the Relp::Engine. An engine must be instantiated and passed as an initializer argument to Relp::Client and Relp::Server instances. Each of these roles also support a destroy method which will gracefully shutdown the engine and transfer state. This pretty much resembles the {rsyslog}[http://rsyslog.com] Output / Input module design and we had to jump through some hoops in order to hide these details from the end user.
# client process
engine = Relp::Engine.new
@@ -66,11 +66,11 @@ All protocol and connection state's kept within a single context, the Relp::Engi
Don't know and in the interim, don't care. It's fast enough for most use cases - shipping events to an event sink in a reliable manner. There's two things to note here :
-* [librelp](http://www.librelp.com) uses the [select](http://en.wikipedia.org/wiki/Select_(Unix)) syscall for I/O multiplexing. This is primarily for portability but also mirrors the [rsyslog](http://rsyslog.com/) Output -> Input module and subsequent [librelp](http://www.librelp.com) design. It's thus not designed for thousands on concurrent clients on the server side, for which a platform specific epoll, kqueue etc. implementation is preferred.
+* {librelp}[http://www.librelp.com] uses the {select}[http://en.wikipedia.org/wiki/Select_(Unix)] syscall for I/O multiplexing. This is primarily for portability but also mirrors the {rsyslog}[http://rsyslog.com/] Output -> Input module and subsequent {librelp}[http://www.librelp.com] design. It's thus not designed for thousands on concurrent clients on the server side, for which a platform specific epoll, kqueue etc. implementation is preferred.
* The RELP protocol uses consistent framing - there's thus additional parsing overhead for participants. This is negligible though.
-Use [rsyslog](http://rsyslog.com/) with the [RELP Input Module](http://rsyslog.com/doc/imrelp.html) as an event sink if you must.
+Use {rsyslog}[http://rsyslog.com/] with the {RELP Input Module}[http://rsyslog.com/doc/imrelp.html] as an event sink if you must.
== Resources
View
@@ -1,3 +1,41 @@
+# encoding: utf-8
+
+#--
+#
+# Author:: Lourens Naudé
+# Homepage:: http://github.com/methodmissing/rbczmq
+# Date:: 20120123
+#
+#----------------------------------------------------------------------------
+#
+# Copyright (C) 2012 by Lourens Naudé. All Rights Reserved.
+# Email: lourens at methodmissing dot com
+#
+# (The MIT License)
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# 'Software'), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+#---------------------------------------------------------------------------
+#
+#
+
# Prefer compiled Rubinius bytecode in .rbx/
ENV["RBXOPT"] = "-Xrbc.db"
@@ -11,6 +49,8 @@
module Relp
+ # Map numeric librelp return codes to end user friendly strings
+ #
ERRORS = {
OUT_OF_MEMORY => "out of memory occured",
INVALID_FRAME => "relp frame received is invalid",
View
@@ -1,6 +1,47 @@
+# encoding: utf-8
+
+#--
+#
+# Author:: Lourens Naudé
+# Homepage:: http://github.com/methodmissing/rbczmq
+# Date:: 20120123
+#
+#----------------------------------------------------------------------------
+#
+# Copyright (C) 2012 by Lourens Naudé. All Rights Reserved.
+# Email: lourens at methodmissing dot com
+#
+# (The MIT License)
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# 'Software'), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+#---------------------------------------------------------------------------
+#
+#
+
require 'socket'
class Relp::Client
+
+ # Sugaring for spawning a new client without manual Relp::Engine init
+ #
def self.connect(sock_family = Socket::AF_INET, hostname = 'localhost', port = 518)
engine = Relp::Engine.new
client = new(engine)
View
@@ -1,4 +1,45 @@
+# encoding: utf-8
+
+#--
+#
+# Author:: Lourens Naudé
+# Homepage:: http://github.com/methodmissing/rbczmq
+# Date:: 20120123
+#
+#----------------------------------------------------------------------------
+#
+# Copyright (C) 2012 by Lourens Naudé. All Rights Reserved.
+# Email: lourens at methodmissing dot com
+#
+# (The MIT License)
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# 'Software'), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+#---------------------------------------------------------------------------
+#
+#
+
class Relp::Server
+
+ # Sugaring for spawning a new server without manual Relp::Engine init
+ #
def self.bind(port, cb = nil)
engine = Relp::Engine.new
server = new(engine)
View
@@ -1,3 +1,41 @@
+# encoding: utf-8
+
+#--
+#
+# Author:: Lourens Naudé
+# Homepage:: http://github.com/methodmissing/rbczmq
+# Date:: 20120123
+#
+#----------------------------------------------------------------------------
+#
+# Copyright (C) 2012 by Lourens Naudé. All Rights Reserved.
+# Email: lourens at methodmissing dot com
+#
+# (The MIT License)
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# 'Software'), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+#---------------------------------------------------------------------------
+#
+#
+
module Relp
VERSION = '0.0.1'
end

0 comments on commit 0b6ccbe

Please sign in to comment.