Skip to content

Commit 285e554

Browse files
fixup! EDU-1469: Re-writes idempotent publishing section to improve clarity to the reader
1 parent ceb877d commit 285e554

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Diff for: content/channels/index.textile

+6-7
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,6 @@ In these cases, you can manually specify the message ID for REST and realtime pu
771771

772772
The following example manually specifies a message ID:
773773

774-
775774
```[realtime_javascript]
776775
const realtime = new Ably.Realtime = '{{API_KEY}}';
777776
const channel = realtime.channels.get('{{RANDOM_CHANNEL_NAME}}');
@@ -826,9 +825,9 @@ ARTRealtimeChannel *channel = [realtime.channels get:("{{RANDOM_CHANNEL_NAME}}")
826825

827826
```[realtime_flutter]
828827
final clientOptions = ably.ClientOptions(key: '{{API_KEY}}');
829-
final rest = ably.Realtime(options: clientOptions);
828+
final realtime = ably.Realtime(options: clientOptions);
830829
final channel = realtime.channels.get('{{RANDOM_CHANNEL_NAME}}');
831-
final message = ably.Message(data: 'payload', id: 'unique123');
830+
await message = ably.Message(data: 'payload', id: 'unique123');
832831
```
833832

834833
```[realtime_go]
@@ -870,7 +869,7 @@ channel = rest.channels.get('{{RANDOM_CHANNEL_NAME}}')
870869
await channel.publish([{data: 'payload', id: 'unique123'}])
871870
```
872871

873-
```[rest_PHP]
872+
```[rest_php]
874873
$rest = new Ably\AblyRest('{{API_KEY}}');
875874
$channel = $rest->channels->get('{{RANDOM_CHANNEL_NAME}}')
876875
$channel->publish([{data: 'payload', id: 'unique123'}]);
@@ -895,7 +894,7 @@ channel publish:@"example" data:@"payload" id:@"unique123" callback:^(ARTErrorIn
895894
```[rest_swift]
896895
let rest = ARTRest(key: "{{API_KEY}}")
897896
var channel = rest.channels.get("{{RANDOM_CHANNEL_NAME}}")
898-
channel.publish([ARTMessage(name: "example", data: "message data", id: "unique123")])
897+
channel.publish("example", data: "message data", id: "unique123")
899898
```
900899

901900
```[rest_objc]
@@ -908,7 +907,7 @@ ARTRestChannel *channel = [rest.channels get:("{{RANDOM_CHANNEL_NAME}}");
908907
final clientOptions = ably.ClientOptions(key: '{{API_KEY}}');
909908
final rest = ably.Rest(options: clientOptions);
910909
final channel = rest.channels.get('{{RANDOM_CHANNEL_NAME}}');
911-
final message = ably.Message(data: 'payload', id: 'unique123');
910+
await message = ably.Message(data: 'payload', id: 'unique123');
912911
```
913912

914913
```[rest_go]
@@ -928,7 +927,7 @@ message := &ably.Message{
928927

929928
h4. Restrictions and considerations
930929

931-
When specifying custom message IDs, particularly when attempting to "publish()":/api/rest-sdk/channels#publish multiple messages atomically with idempotency, ensure that the IDs adhere to the format restrictions. For more details on these restrictions, refer to the "FAQ":https://faqs.ably.com/client-specified-message-id-restrictions-for-multiple-messages-published-atomically.
930+
When specifying custom message IDs, particularly when attempting to "@publish()@":/api/rest-sdk/channels#publish multiple messages atomically with idempotency, ensure that the IDs adhere to the format restrictions. For more details on these restrictions, refer to the "FAQ":https://faqs.ably.com/client-specified-message-id-restrictions-for-multiple-messages-published-atomically.
932931

933932
h3(#publish-on-behalf). Use the REST interface to publish on behalf of a realtime connection
934933

0 commit comments

Comments
 (0)