bufferevent callbacks do not receive the bufferevent object
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 4
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
```
What steps will reproduce the problem?
1. Instantiate a bufferevent, using a read callback of your choice.
What is the expected output? What do you see instead?
I expected pyevent to pass the bufferevent object to the read callback. Since
the bufferevent object is not passed, the callback has no way to call
bufferevent.read().
I can work around the problem by storing a bufferevent object reference in a
global variable, or by making each callback an object instead of a function and
storing a bufferevent object reference in the callback object at setup time.
However, both these workarounds are messy, harder to understand, and have
undesirable side effects (like reference loops).
What version of the product are you using? On what operating system?
I'm using pyevent 0.3, from the python-event 0.3+svn60-3 package, on Ubuntu
Maverick.
Please provide any additional information below.
This problem would be easily solved if the bufferevent callbacks received a
reference to their bufferevent, just as they do in the libevent C API:
http://monkey.org/~provos/libevent/doxygen-2.0.1/bufferevent_8h.html#90faa2b8565
af16c85814d4679586b5b
```
Original issue reported on code.google.com by `foresto@gmail.com` on 15 Jan 2011 at 10:42
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the pyevent bufferevent callback entry point and compare its arguments with the linked libevent C API documentation. Confirm how callbacks are currently invoked and determine what regression coverage exists or is needed; done means callbacks receive their bufferevent object and can call bufferevent.read().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100