Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zyre binding #133

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open

Zyre binding #133

wants to merge 42 commits into from

Conversation

wysman
Copy link
Contributor

@wysman wysman commented Jul 3, 2014

Add the class ZMQZyre which is a binding of the libzyre. Zyre is an open-source framework for proximity-based peer-to-peer applications. Zyre is based on ZMQ and supported by iMatix.

The ZMQZyre class is add to the php extension if all library dependency are validate, if not this part of the code is disable automatically to avoid build error.

  • libzyre == 1.x.x
  • czmq >= 2.2.0

zend_object zend_object;
zctx_t *shadow_context;
zyre_t *zyre;
zval *internalSocket;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this member camelcase and the rest are underscore?

int data_len, peer_len;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &peer, &peer_len, &data, &data_len) == FAILURE) {
RETURN_FALSE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple return here as well

@mkoppanen
Copy link
Collaborator

Hi,

looks good! Added a few inline comments.

@wysman
Copy link
Contributor Author

wysman commented Jul 3, 2014

Hi,
Thanks for your review, previous commits fix your remarks.
I will add 1/2 methods to the class and some others tests ASAP

@wysman
Copy link
Contributor Author

wysman commented Jul 3, 2014

@mkoppanen Well done, Mr travis is green.
Can you review again the socket creating and delete, Thanks

https://github.com/wysman/php-zmq/blob/zyre/zmq.c#L1987
https://github.com/wysman/php-zmq/blob/zyre/zmq.c#L1617

@wysman
Copy link
Contributor Author

wysman commented Jul 16, 2014

I just realize that "zend_throw_exception_ex" do not break the execution flow like C++ exception.
Can you suggest a good book about php extension writing ?

@mkoppanen
Copy link
Collaborator

The only book I know is Sara Golemon's book and that's getting a bit dated.

zval_ptr_dtor (&zmq_zyre->internal_socket);
}

if (zmq_zyre->zyre != NULL) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation here?

wysman added 3 commits October 8, 2014 13:39
Conflicts:
	.travis.yml
	api.php
	config.m4
	php_zmq_private.h
	travis/script.sh
	zmq.c
@mkoppanen
Copy link
Collaborator

Abandoned?

@wysman
Copy link
Contributor Author

wysman commented Jan 14, 2016

Hi,

I do not have work on this feature for a while, but it was left working and cover with tests units.
Maybe we can upgrade the branch to support the last zyre release 7 days ago.

William

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants