Skip to content

Commit 68c384e

Browse files
committed
Document the unmarshaller api
Signed-off-by: Fabio José <[email protected]>
1 parent d418789 commit 68c384e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,29 @@ Promise Receiver.listen()
378378
Receiver.stop()
379379
```
380380

381+
### `Unmarshaller` classes
382+
383+
The Unmarshaller classes uses the receiver API, abstracting the formats:
384+
385+
- structured
386+
- binary
387+
388+
Choosing the right implementation based on the `headers` map.
389+
390+
```js
391+
/*
392+
* Constructor without arguments
393+
*/
394+
Unmarshaller()
395+
396+
/*
397+
* The method to unmarshall the payload.
398+
* @arg payload could be a string or a object
399+
* @arg headers a map of headers
400+
*/
401+
Promise Unmarshaller.unmarshall(payload, headers)
402+
```
403+
381404
> See how to implement the method injection [here](lib/specs/spec_0_1.js#L17)
382405
>
383406
> Learn about [Builder Design Pattern](https://en.wikipedia.org/wiki/Builder_pattern)

0 commit comments

Comments
 (0)