Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed May 10, 2024
1 parent e966135 commit acbb817
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
26 changes: 0 additions & 26 deletions _examples/compression_playground/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@ func main() {
log.Println(entry.Message, entry.Fields)
},
AllowedDeltaTypes: []centrifuge.DeltaType{centrifuge.DeltaTypeFossil},
//GetChannelLayerOptions: func(channel string) (centrifuge.ChannelMediumOptions, bool) {
// return centrifuge.ChannelMediumOptions{
// //KeepLatestPublication: true,
// //EnableQueue: true,
// //BroadcastDelay: 500 * time.Millisecond,
// }, true
//},
})
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -202,30 +195,11 @@ func main() {
useProtobufPayload = true
}

//go func() {
// time.Sleep(500 * time.Millisecond)
// client.Disconnect(centrifuge.DisconnectForceReconnect)
//}()

go func() {
log.Printf("using protobuf payload: %v", useProtobufPayload)
simulateMatch(client.Context(), 0, node, useProtobufPayload)
}()

//client.OnCacheEmpty(func(event centrifuge.CacheEmptyEvent) centrifuge.CacheEmptyReply {
// simulateMatch(context.Background(), 0, node)
// //go func() {
// // num := 0
// // for {
// //
// // num++
// // time.Sleep(5 * time.Second)
// // }
// //}()
// fmt.Println("simulated")
// return centrifuge.CacheEmptyReply{Populated: true}
//})

// Set SubscribeHandler to react on every channel subscription attempt
// initiated by a client. Here you can theoretically return an error or
// disconnect a client from a server if needed. But here we just accept
Expand Down
4 changes: 4 additions & 0 deletions _examples/compression_playground/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
This is a sample simulation of football match where the entire state is sent into WebSocket connection upon every
match event.

The goal is to compare different compression strategies for WebSocket data transfer. Please note, that results
depend a lot on the data you send. You may get absolutely different results for your data. Still we hope this
example gives some insights on how to choose the best compression strategy and what to expect from Centrifuge.

Results with different configurations for total data sent over the interface from server to client,
caught with WireShark filter:

Expand Down

0 comments on commit acbb817

Please sign in to comment.