Skip to content

Commit

Permalink
Update wamp.md
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim authored Oct 24, 2018
1 parent 11d1e3e commit c00b753
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/transport/wamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ use Enqueue\Wamp\WampConnectionFactory;

$connectionFactory = new WampConnectionFactory();

$context = $connectionFactory->createContext();
// same as above
$connectionFactory = new WampConnectionFactory('wamp:');
$connectionFactory = new WampConnectionFactory('ws:');
$connectionFactory = new WampConnectionFactory('wamp://127.0.0.1:9090');

// if you have enqueue/enqueue library installed you can use a factory to build context from DSN
$context = (new \Enqueue\ConnectionFactoryFactory())->create('wamp:')->createContext();
$context = $connectionFactory->createContext();
```

## Consume message:
Expand Down Expand Up @@ -100,4 +102,4 @@ $message = $context->createMessage('Hello world!');
$context->createProducer()->send($fooTopic, $message);
```

[back to index](../index.md)
[back to index](../index.md)

0 comments on commit c00b753

Please sign in to comment.