Skip to content

Feature/message type handler - #64

Merged
jmglsn merged 3 commits into
stomp-php:masterfrom
fin-sn-de:feature/message-type-handler
Dec 18, 2016
Merged

Feature/message type handler#64
jmglsn merged 3 commits into
stomp-php:masterfrom
fin-sn-de:feature/message-type-handler

Conversation

@jmglsn

@jmglsn jmglsn commented Dec 11, 2016

Copy link
Copy Markdown
Member

Some days ago I was using our stomp library again and found out that it's quite complicated to register own message types.

I added the FrameFactory which gives access to the logic that was previously inside setFrame. Now it's possible to register own resolver which allows to register domain specific messages.

Comment thread src/Stomp/Transport/FrameFactory.php Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

closure[]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah callable[] to be precise.

Comment thread src/Stomp/Transport/Map.php Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Per phpdoc $body can either be Frame of string. What values are handled in this Else-branch?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good point 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's more like a legacy issue here. I'll drop the frame part and break it down to string will get parsed by json_decode and any other input will be wrapped with json_ecnode.

- introduced by myself during a refactoring session...
@jmglsn
jmglsn force-pushed the feature/message-type-handler branch from 1149263 to 4db9c7e Compare December 18, 2016 11:32
@jmglsn
jmglsn force-pushed the feature/message-type-handler branch from 4db9c7e to 14331a8 Compare December 18, 2016 11:39
@jmglsn
jmglsn merged commit b543b3f into stomp-php:master Dec 18, 2016
@jmglsn
jmglsn deleted the feature/message-type-handler branch December 18, 2016 12:30
jmglsn added a commit to stomp-php/stomp-php-examples that referenced this pull request Dec 18, 2016
jmglsn added a commit to stomp-php/stomp-php-examples that referenced this pull request May 31, 2017
jmglsn added a commit to stomp-php/stomp-php-examples that referenced this pull request Jun 11, 2017
* add an example for custom message types (stomp-php/stomp-php#64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants