Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update the documentation

  • Loading branch information...
commit 7a4b8791a52d26c54dd673a413dd43032db0eaea 1 parent 5f9bac2
Brian Maher authored

Showing 2 changed files with 32 additions and 12 deletions. Show diff stats Hide diff stats

  1. +1 0  CMakeLists.txt
  2. +31 12 README
1  CMakeLists.txt
... ... @@ -1,3 +1,4 @@
  1 +# This cmake file was inspired by:
1 2 # Copyright (C) 2007-2009 LuaDist.
2 3 # Submitted by David Manura
3 4 # Redistribution and use of this file is allowed according to the
43 README
@@ -4,7 +4,7 @@
4 4 *
5 5 * The MIT License
6 6 *
7   -* Copyright (c) 2009 Brian Maher
  7 +* Copyright (c) 2009-1010 Brian Maher
8 8 *
9 9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 10 * of this software and associated documentation files (the "Software"), to deal
@@ -41,14 +41,6 @@ Loading the library:
41 41 the function "luaopen_ev(L)". It will create a table with the ev
42 42 functions and leave it on the stack.
43 43
44   -IMPORTANT IMPLEMENTATION NOTE:
45   -
46   - Currently all callbacks registered by this implementation
47   - rely on a thread-local in order to get the current lua_State.
48   - This means any call in other C code directly to the ev_loop() C
49   - API function call may cause fatal errors. If you have ideas on
50   - how to lift this restriction, please let the maintainer know!
51   -
52 44 -- ev functions --
53 45
54 46 major, minor = ev.version()
@@ -227,9 +219,10 @@ revents = timer:clear_pending()
227 219
228 220 See also ev_clear_pending() C function.
229 221
230   -on_timeout = timer:callback()
  222 +old_on_timeout = timer:callback([new_on_timeout])
231 223
232   - Get access to the callback function associated with this timer.
  224 + Get access to the callback function associated with this timer,
  225 + optionally setting a new callback function.
233 226
234 227 -- ev.IO object methods --
235 228
@@ -273,5 +266,31 @@ revents = io:clear_pending()
273 266
274 267 on_timeout = io:callback()
275 268
276   - Get access to the callback function associated with this io.
  269 + Get access to the callback function associated with this timer,
  270 + optionally setting a new callback function.
  271 +
  272 +EXCEPTION HANDLING NOTE:
  273 +
  274 + If there is an exception when calling a watcher callback, the error
  275 + will be printed to stderr. In the future, it would be cool if
  276 + there was a linked list of error handlers, and that if a callback
  277 + registers another callback, this linked list of error handlers
  278 + would be inherited so that exception handling can be done more
  279 + easily. To do this, we just need to add a method for adding an
  280 + error handler for the current callback context, and keep calling
  281 + the error handlers in the linked list until an error handler
  282 + actually handles the exception. If the error handling stack
  283 + unwinds, we will probably just resort to printing to stderr.
  284 +
  285 +IMPROVEMENT NOTE:
  286 +
  287 + You can now call ev_loop() directly from the C API (in the past
  288 + there was assumptions in the callback implementation).
  289 +
  290 +TODO:
  291 +
  292 + * Make the pthread library optional (currently we just register the
  293 + libev ev_default_fork function via pthread_atfork).
277 294
  295 + * Add support for other watcher types (signals, stat, periodic,
  296 + child, idle, embed, async, etc).

0 comments on commit 7a4b879

Please sign in to comment.
Something went wrong with that request. Please try again.