-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream enhancements #268
base: trunk
Are you sure you want to change the base?
stream enhancements #268
Conversation
var fileName = valueObject.split(':')[1]; | ||
var fileLength = int.parse(valueObject.split(':')[2]); | ||
fileName = utf8.decode(base64.decode(fileName)); | ||
final streamNotification = StreamNotificationParser('atmosphere') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the atmosphere is typed here?
.parseStreamNotification(atNotification); | ||
if (streamNotification == null) { | ||
return; | ||
} | ||
var userResponse = true; //UI user response | ||
if (userResponse == true) { | ||
print('user accepted transfer.Sending ack back'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to log
@@ -49,7 +61,7 @@ Future<void> _notificationCallBack(AtNotification atNotification) async { | |||
} | |||
} | |||
|
|||
void _streamReceiveCallBack(var bytesReceived) { | |||
void _streamProgressCallBack(var bytesReceived) { | |||
print('Receive callback bytes received: $bytesReceived'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print .. should we retain?
var atStreamRequest = AtStreamRequest('@bob🛠', '/home/murali/Pictures/@/cat.jpeg'); | ||
atStreamRequest.namespace = 'atmosphere'; | ||
final streamSender = | ||
atClientManager.streamService.createStream(StreamType.SEND).sender; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking "atClientManager.streamService.createStream(StreamType.SEND)" to return a StreamSender without calling a ".sender". Will discuss in a call.
onDone(atStreamResponse); | ||
} | ||
} else if (result != null && result.startsWith('error:')) { | ||
result = result.replaceAll('error:', ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use the response parser
/// onDone[AtStreamResponse] is called upon stream completion. | ||
/// onError[AtStreamResponse] is called when stream errors out. | ||
/// If a stream transfer has to be resumed then specify [atStreamRequest.startByte]. Stream transfer will be resumed from startByte. | ||
Future<void> send(AtStreamRequest atStreamRequest, Function onDone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can an app send two-stream requests in parallel? i.e calling send for two files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the stream id is important for the caller to know before onDone or onError is called?
@murali-shris Is there code here which will be useful when we revisit stream properly? If so, please mark as draft for now, otherwise please close and delete the branch. |
- What I did
- How I did it
- How to verify it
- Description for the changelog