Commit graph

70 commits

Author SHA1 Message Date
Jason Rhinelander e4b9a39fd0
Merge pull request #10 from jagerman/fixes
Fixes
2021-12-03 15:39:55 -04:00
Jason Rhinelander 36e32066d0
Version bump 2021-12-03 13:10:19 -04:00
Jason Rhinelander 4136c29d06
Make Message property accessors copy
The default references, which breaks because Message gets reused, so
storing `.conn` gives you something that changes the next time a worker
gets a message.
2021-12-03 13:08:11 -04:00
Jason Rhinelander f1160d0a25
Make allow_connection properly optional 2021-12-03 13:07:49 -04:00
Jason Rhinelander 4020ab8a49
Make ConnectionIDs hashable 2021-12-03 13:07:35 -04:00
Jason Rhinelander a678fcf0ce
Remove include for older pybind compatibility 2021-12-02 15:39:54 -04:00
Jason Rhinelander 59e86ab6b6
Merge pull request #9 from jagerman/fix-allow-func
Fix allow function argument decoding error
2021-12-02 15:17:04 -04:00
Jason Rhinelander 530280ac60
Fix allow function argument decoding error
Avoids a utf-8 decoding error when accepting a connection with an allow
function by properly wrapping the function in a version that passes
pubkey as a `bytes`.
2021-12-02 15:14:54 -04:00
Jason Rhinelander 367007dd66 Update readme for new code 2021-10-22 20:22:54 -03:00
Jason Rhinelander 06e0e2eb44
Merge pull request #7 from jagerman/redo
pyoxenmq overhaul
2021-10-22 20:09:09 -03:00
Jason Rhinelander b12c754895 Fixes and address warnings
- timeout in the syncronous connect_remote wasn't being passed through
- callback and syncronous connect_remote had some deviation in args;
  unified them to both take keyword-only timeout and
  ephemeral_routing_id, and to take timeout as a timedelta with a
  default (rather than an optional in the callback-based one).
- removed unused "noopt".  I forget what it was for, but it didn't end
  up being used.
2021-10-22 19:12:57 -03:00
Jason Rhinelander 6d59248f45 Build with -Wextra -Werror and color 2021-10-22 19:12:57 -03:00
Jason Rhinelander 97238b04ba Hacking around for macos
Build local oxenmq

Install everything into a local prefix
2021-10-22 19:12:57 -03:00
Jason Rhinelander 996370228c Add drone build & tests 2021-10-22 19:12:57 -03:00
Jason Rhinelander 171e94cf11 Add simple pytest tests 2021-10-22 17:03:06 -03:00
Jason Rhinelander 5ceed8a416 Various fixes for bugs revealed in testing
- make extract data parts always flatten to arbitrary depth.  We were
  only flattening once (and only sometimes), but arbitrary flattening is
  nicer (as long as we don't ultimately encouter anything that isn't
  str/bytes).
- fix Message.data()/.dataview() pre-loading nulls into the list.  The
  py::list constructor argument here is pre-fill, not a reservation.
- fix add_command: it was broken because when the wrapped callback gets
  invoked it tries casting the Message via copying, but that breaks
  (Message isn't copyable).  Fix it by adding a wrapper that does a
  referencing cast to a Python object.
- Add missing docs for add_command
- Doc typo fixes
- Remove OxenMQ default and loglevel constructors, and make the
  remaining constructor take everything by keyword arguments.  (Default
  constructor remains equivalent, and the log-level constructor now has
  to have the log level named).
- Fix OxenMQ keyword constructor: invoking it was failing because the
  annotation default on sn_lookup wasn't properly castable to the
  required types (it should be py::none() rather than nullptr).  Also
  fix the defaults for pubkey/privkey to be py::bytes() (the empty
  string worked fine, but using bytes makes it show up as bytes defaults
  in the generated signature doc string).
- Further document connect_inproc with a description of why you might
  want it.
- Fix send not actually including the message data parts
- Work around segfault in the reply callback: because we have lambdas
  with python object captures, we'd segfault in the proxy thread when it
  frees them after calling them because that freeing invokes python
  destructor but it doesn't hold the gil.  Fixed by making the lambda
  consume its own callbacks (which is fine because oxenmq will invoke
  the callback exactly once).
- Fix request_future invocation which raised an error on invocation:
  straight lambdas aren't castable to python objects, so stuff the
  lambda inside std::functions, which are.
2021-10-22 16:28:21 -03:00
Jason Rhinelander 6a382865b2 Remove cmake build system and submodules
setup.py works fine, and we don't need two separate build systems.

Remove the submodules as well because we aren't using them and don't
need them; you should install pybind11 and oxenmq outside this project.
2021-10-22 16:09:36 -03:00
Jason Rhinelander a62f6c4769 Formatting 2021-10-22 16:08:57 -03:00
Jason Rhinelander c4d9eb8a8f De-Frankenstein the build 2021-10-22 00:45:15 -03:00
Jason Rhinelander 0e1283784e Remove unwanted headers
- pybind11/gil.h is only in recent pybind (but is implicitly included by
  the main pybind11.h header)
- detail/common shouldn't be included
2021-10-21 23:47:58 -03:00
Jason Rhinelander a98722a7da pyoxenmq overhaul
- Wrap much more of the OxenMQ
- Add extensive pydoc to everything
- Switch setup.py to pybind's built-in tools
2021-10-21 22:23:02 -03:00
Jeff feb28e1973
Merge pull request #6 from jagerman/oxenmq-updates
Oxenmq updates
2021-06-20 03:59:15 -04:00
Jason Rhinelander 959df9c5dd Remove duplicate method
Not sure why this was here, but AFAICT it is identical to
`add_request_command` without the `_ex`.
2021-06-19 22:58:03 -03:00
Jason Rhinelander 2805d01f6b Update old routing id field name 2021-06-19 22:58:03 -03:00
Jason Rhinelander 739e445c03 Rename to pyoxenmq
Finish renaming everything from loki->oxen, and update to latest
oxen-mq submodule.
2021-06-19 22:57:43 -03:00
Jeff 9ac2d20632
Merge pull request #5 from majestrate/oxen-refactor-2021-02-01
update readme
2021-04-14 13:27:41 -04:00
Jeff Becker f7d562f5d1
update readme
* fix urls
* fix names
2021-04-14 13:23:07 -04:00
Jason Rhinelander 56239c9390 Fix loki-mq submodule path 2021-02-27 13:26:12 -04:00
Jeff 8c75af04ca
Merge pull request #4 from majestrate/oxen-refactor-2021-02-01
loki -> oxen refactor
2021-02-18 06:07:03 -05:00
Jeff Becker 4597f5ca6c
loki -> oxen refactor
* rename all namespaces so it compiles again
2021-02-01 10:48:27 -05:00
Jeff aade6d835c
Merge pull request #3 from loki-project/KeeJef-patch-1
Add dependencies
2020-11-26 05:06:09 -05:00
Kee Jefferys 2c13d931d9
Add dependencies
Not sure if this is the full or accurate list, was what i needed to install
2020-11-26 13:43:56 +11:00
Jeff Becker 5ebc6ee614
add lokinet.auth package 2020-11-09 08:51:40 -05:00
Jeff Becker 3787a12fcd
package lokinet package 2020-11-09 08:32:28 -05:00
Jeff Becker fc1a85da79
build lokimq from pkg-config 2020-11-09 08:32:10 -05:00
Jeff 626316e49c update readme and ignore 2020-10-03 12:33:49 -04:00
Jeff a3d3aafb5c dont use reference in arguments 2020-09-24 11:59:45 -04:00
Jeff f568f911d1 use py::function 2020-09-24 11:59:36 -04:00
Jeff 6ea7941862 wrap lokimq::Message 2020-09-24 11:59:19 -04:00
Jeff 532d530836 move py::bytes construction inside scoped acquire 2020-09-24 11:42:24 -04:00
Jeff 8a6bdde9a1 add setuptools files 2020-09-24 11:35:25 -04:00
Jeff 353a431ee7 fix 2020-09-14 09:39:51 -04:00
Jeff 191e7894c9 typo 2020-09-14 09:38:43 -04:00
Jeff c08cc6c0c9 fix it again 2020-09-14 09:37:45 -04:00
Jeff 5613a3aacd again 2020-09-14 09:36:07 -04:00
Jeff 162aac9de4 fix it again 2020-09-14 09:34:37 -04:00
Jeff 52f2a16fb2 fix bdecode 2020-09-14 09:31:00 -04:00
Jeff e2f34fd821 fix exit auth script 2020-09-14 09:12:51 -04:00
Jeff 2595ceb1b7 use bytes instead of string in handler functions 2020-09-14 06:57:05 -04:00
Jeff 0de703577c add equals method for connection ids 2020-09-13 12:19:51 -04:00