Wear Channel API gets one file per channel - wear-os

Anybody got a handle on the new Channel API? 
The Android site says it can be used to send music files, for example. However, the docs for the Channel object say that receiveFile and sendFile should only be used once on any channel. The only example using channel I can find is here on StackOverflow to send a single file. How can Channel send many files? Does an app create many channels? Is the developer supposed to combine the files into one?
Any insight would be most welcome. Is there any reason to update code that uses assets to use channels instead?

You can have multiple channels so the easiest is to open one channel per file if you need to try multiple transfers.

Related

Forwarding teams channel messages to another teams channel

I'm a member in a MS Teams channel which sends some notification messages, is there's a way to automatically forward these messages from that channel to another channel of my own.
Thanks.
I would recommend you have a look at Automate with Microsoft
Accept the question if this helps you but please read the docs of Power Automate carefully :)

Count open socket and channel connections in a Phoenix application

Is there a relatively simple, documented way in a Phoenix application to read how many active sockets and channels are currently open at any given time? And more specifically, is it possible to filter this data by topic and other channel connection metadata?
My use case is for analytics on active connections to my backend.
Thanks for any suggestions!
You are looking for Phoenix.Presence. From the documentation:
Provides Presence tracking to processes and channels.
This behaviour provides presence features such as fetching presences for a given topic, as well as handling diffs of join and leave events as they occur in real-time. Using this module defines a supervisor and allows the calling module to implement the Phoenix.Tracker behaviour which starts a tracker process to handle presence information.
Basically, you are supposed to implement Phoenix.Presence behaviour (the almost ready-to-go example is there in docs,) and Phoenix.Tracker according to your needs.

OpenTok Signalling for Sending Files

Does anyone know if OpenToks sendSignal() method is peer to peer? Or does it get routed through OpenTok's servers? We are looking to send image and video files P2P, but the signaling method seems a bit slower than webRTC's native data channel. I'm wondering if there is something extra happening under the hood.
From the documentation, you should be able to send to a specific end: https://tokbox.com/developer/sdks/js/reference/Session.html#signal. What you need to do is to specify a Connection object.

Spring integration imap - multiple email accounts from the same domain

I'm using spring's imap mechanism in order to recieve emails from my account into my server.
this works like a charm.
Anyhow, a new requirmemnt came up - instead of listening to a single email account i will have to listen on a multiple number of accounts.
Iv'e tried creating a new channel for each of these account. it WORKS!
problem is that each channel i added meaning a new thread running.
since i'm talking about a large number of accounts it is quiet an issue.
My question is:
Since all the email accounts (I would like to listen to) are in the same domain i.e:
acount1#myDomain.com
acount2#myDomain.com
acount3#myDomain.com
....
Is it possible to create a single channel with multiple accounts?
Is there any alternative for me than defining N new channels?
thanks.
Nir
I assume you mean channel adapter, not channel (multiple channel adapters can send messages to the same channel).
No, you can't use a single connection for multiple accounts.
This is a limitation of the underlying internet mail protocols.
If you are using imap idle adapters, yes, this will not scale well because it needs a thread for each. However, if you are only talking about a few 10s of accounts, this is probably not an issue. For a much larger number of accounts, it may be better to use a polled adapter.
But, even so, unless it's a fixed number of accounts, the configuration could be burdensome (but you could programmatically spin up new adapters).
For complex scenarios like this, you may want to consider writing your own "adapter" that uses the JavaMail API directly and manages the connections in a more sophisticated way (but you still need a separate connection for each account). It wouldn't have to be a "real" adapter, just a POJO that interracts with JavaMail. Then, when you receive a message from one of the accounts, send it to a channel using a <gateway/>.

How to check if the channel is still working in streadway/amqp RabbitMQ client? [duplicate]

This question already has answers here:
How to detect dead RabbitMQ connection?
(4 answers)
Closed 10 months ago.
I'm using github.com/streadway/amqp for my program. How should I make sure that the channel I'm using for consumption and/or production is still working, before re-initializing it?
For example, in ruby, I could simply do:
bunny_client = Bunny.new({....})
bunny_client.start
to start the client, and
if not bunny_client or bunny_client.status != :connected
# re-initialize the client
How to do this with streadway/amqp client?
The QueueDeclare and QueueInspect functions may provide equivalent functionality. According to the docs:
QueueInspect:
Use this method to check how many unacknowledged messages reside in the queue and how many consumers are receiving deliveries and whether a queue by this name already exists.
If the queue by this name exists, use Channel.QueueDeclare check if it is declared with specific parameters.
If a queue by this name does not exist, an error will be returned and the channel will be closed.
QueueDeclare:
QueueDeclare declares a queue to hold messages and deliver to consumers. Declaring creates a queue if it doesn't already exist, or ensures that an existing queue matches the same parameters.
It looks like there's some good info regarding Durable queues (survive server restarts) in those docs as well.
I have worked around most connectivity issues by trial and error seeing which patterns will work and which won't. I think the best method is to flag a channel when using it (on error). If it fails to publish it gets flagged as well on library side. The errors that are received from server automatically terminate the channel anyways so it just tells my channel pool to rebuild channels when flagged.
You can use my library in golang as an example to create a connection/channelpool and how I flag channels on error.
https://github.com/houseofcat/turbocookedrabbit

Resources